) Eclipse remote debugging WebSphere Application Server (WAS)

Source: Internet
Author: User
Tags websphere application server

Currently, most of the application servers used in our project are websphere, which has been unable to be debugged. Today I see an article on the Internet. The original Article is http://www.blogjava.net/unmi/archive/2009/05/12/270213.html:

When we use eclipse to develop web projects, we usually use a plug-in (such as myeclipse) to perform one-step debugging on Tomcat applications. To debug applications under was, myeclipse is also acceptable, but it is slow to start was in myeclipse, and a was must be installed locally. Another convenient method is to use wsad (WebSphere Studio Application Developer) or its upgraded version rad (rational application developer), which has built-in support for was, however, was needs to be installed on the local machine, so it is not necessary to say that the body of wsad/rad is fat. To allow wsad/rad for remote debugging, it seems that an IBM agent controller has to be installed on the server.

In fact, was supports remote debugging settings. You only need to use the remote Java application function in eclipse debug to connect to the corresponding port on the server. The setting is simple. In this way, you can even secretly debug the was application in the production environment to verify that the test environment is difficult/cannot be reproduced. The procedure is as follows (the operations under was 5.x and 6.x are basically the same ):

1. Configure was to enable the debugging service.
Go to the was (or Nd) console and goServer->ApplicationProgramServer, Click the application server to enable the debugging service, and then enterDebugging Service, SelectStart(Specify whether the server will attempt to start the specified service when the server starts .).JVM debug portThe default value is 7777. Note that this port cannot conflict. (If multiple servers need to enable the debugging service, you must specify other ports ). Other options are set by default or based on actual conditions.
OK,SaveAfter restarting the application server, was base needs to return to the operating system to restart the application server. If it is in the nd console, you can directly restart the application server on the page.

Ii. Configure eclipse and use remote debugging
Eclipse menuRun->Open debug DialogWindow, right-clickRemote Java application->NewInConectTab, selectProject(That is, a project that has been released to was and enabled for debugging in your eclipse ),HostFill in the IP address of the was server,PortThe preceding JVM debugging port. Other two tabsSource/CommonPay attention to it.

Click the debug button. At this time, eclipse processes the status of the JVM debug port of the was server.

3. Click a breakpoint to debug the application.
In your Eclipse project (note that this project has been deployed on was) to debugCodeLine, and then you can browse the application on was on the web page. When you execute the code at the breakpoint, eclipse will stop on the line to let you dance F5/F6 as usual, watch/inspect/display expressions or variables.

Other disadvantages are:
1) if you cannot observe the console output, you must check the systemout. Log File or log file of was.
2) JSP files cannot be debugged because the source code cannot be located and this method is not smart.
3) after the code is updated, manually copy the class file or JSP file to the corresponding directory of was.
4) after the debugging service is started, the function is seriously affected and can be felt by clicking the mouse. Therefore, the function is quickly disabled after the system completes the process.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.