Eclipse Remote Debugging WebLogic running source code

Source: Internet
Author: User
Tags documentation modify client jboss server port number advantage
Web| Source Code

I've seen many examples of remote debugging, most of them are for Tomcat or JBoss server, rarely can search for WebLogic server remote debugging examples and articles, a few days ago in the project development time to try, feel very good, take out to share with you, but I would like to wordy a few words.

The benefits of remote debugging: Most of the patterns we are developing now are the native Eclipse integrated source management environment, the integration of Ant's build environment, the integration of the operating environment with the WebLogic plug-in, basically an eclipse when the father and mother, the advantage is the development of the environment configuration concentration, Ordinary programmers just follow the steps to do it, the development steps are simple, the whole project is a good thing. So stand in the ordinary programmer's angle? Nothing has been learned, is in imitation, if the hardware configuration of the machine if very low, means that the development efficiency of the reduction, while not a bit of development fun, is in the realization of business, it is difficult to understand the characteristics of the tool itself. The advantage of remote debugging is that the centralized configuration is dispersed to allow resources to be allocated on different machines, reducing the use of native resources. In other words, it is a complete separation of the operating environment and the development environment, for those real-time correspondence and conservative programmers, is simply a gospel, the user environment in the event of any bug, you can reproduce and debug in the shortest time, without running the test environment of this machine.

The preparation of remote debugging: Using the Java Platform Debugging architecture, Java Platform Debugger architecture, referred to as JPDA, you can refer to the tool support inside the API documentation in the Java Platform Debugger Architecture (JPDA) (my JDK documentation is 1.42, and if it is a different version, you can search JPDA to find the relevant information). In other words, we use this platform to debug the application, in fact, we will also see in eclipse there are debug, then they are not the same thing? I did a search, basically eclpse debugging is the use and expansion of this tool platform, Only remote debugging requires our own manual configuration, and you are debugging in the local, those configurations are plug-ins to help you complete, you are a user, so not care so much.

Specific implementation steps: Configure the server's startup parameters, if you are familiar with WebLogic, you will find that WebLogic is more Java-enabled. For us, if it's a Windows user, you just need to modify domain

Inside the startweblogic.cmd batch file, you set up a system variable in this file,

The vernacular is you add a line set java_debug=-xdebug-xnoagent-xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n. This is not enough, you also need to add this sentence to%java_home%\bin\java%java_vm%%mem_args%%java_options%-dweblogic.name=%server_name%- dweblogic.productionmodeenabled=%production_mode%-djava.security.policy= "%wl_home%\server\lib\weblogic.policy" Weblogic. In the server

The modified results%java_home%\bin\java%java_vm%%java_debug%%mem_args%%java_options%weblogic. Name=%server_name%-dweblogic.productionmodeenabled=%production_mode%-djava.security.policy= "%WL_HOME%\server\ Lib\weblogic.policy "WebLogic. Server

The purpose of this is to let you start the WebLogic at the same time, the JPDA also started up, as for your weblogic actual startup parameters are not like me, I do not know, anyway, the purpose is to write the JPDA parameters are also loaded into your list of startup parameters, Start WebLogic also will Jpda start up, the specific modification or according to their actual situation to set, but the purpose is the same.

Configuring the client: This side of the client tool is naturally eclipse, originally your local project configuration remains unchanged, in other words, you must also import your project to your eclipse, use and operation and the local no change. But you need to set up a remote Java application, so that after the configuration on it (unfortunately, I will not wear a picture in Jr, or grasp the map, a look at the understanding). Simply put, in your debug has Java Application,java applet,junit and so on, of course there are remote Java application, you can create a new one, simply configure the remote host address and listening port ( You specify 4000 in the server configuration process, select your project and give the remote Java application a name.

Need to pay attention to: When you debug, you must ensure that your local source and server running on the environment on the same class, in a word to say must update source in time, otherwise the results of the debug is inexplicable. And you put your own source. Compiled jar packages or folders on the server, be sure to publish it every time, if you occasionally forget, then although your server running on the class and the local source consistent, because you did not publish, then debug results are inconsistent, So consistency is a twofold meaning.

Summary

In fact, configure remote Debug is not difficult, the basic principle is very simple, server-side in the start of the server at the same time, also put the JPDA explicitly launched, assigning a port number, then you in the client as long as the connection Jpda service (Sun called tool platform, I personally called the service) can be tested Give me the feeling more like a socket programming implementation of the service. As for the other server remote debugging? The principle must be the same, except that you need to modify the parameters of remote debugging according to the documentation they provide. At the same time declare that my personal level is also very general, in the knowledge and experience also has a certain lack, if this post has what is wrong and wrong place, please point out and learn together.



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.