Paip. Java program debugging notes and Process summary

Source: Internet
Author: User

Paip. Java program debugging notes and Process summary

I have been writing Java programs in the past, but I have not summarized them. I will summarize them today for future use.

---- Author attilax, 1466519819@qq.com ---
1. Start Tomcat debugging in IDE (not recommended)
----------------------------------------------
This is actually debugging in the form of sharememory. Some reload problems need to be faced for deploying context.

2. Remote debugging through JPDA (recommended)
------------------------------
Tomcat6w.exe> JAVA optiongs>-agentlib: jdwp = transport = dt_socket, Server = Y, suspend = N, address = 8001

Nb6.5> debug> attach debugger> JPDA, host: yourhostname, Port: XXX in IDE

3. Set Tomcat Automatic Reload
---------------------------------------
In this way, after modifying the class, deploy it through the IDE (by default, it is automatically compiled and deployed after being saved), and then the VM can automatically apply the changes.
<Context Path = "/APP" docbase = "D: \ netbeansprojects \ XX \ build \ Web" reloadable = "true" DEBUG = "9">
<Watchedresource> WEB-INF/struts-config.xml </watchedresource>
<Watchedresource> WEB-INF/Web. xml </watchedresource>
</Context>
However, sometimes it cannot be automatically compiled and deployed.
Note that after the class is modified, there will be an icon on the top (you can see it on the Code view tab, or you can see it when expanding the proj file list ).. Indicates that it has been modified .. If it is automatically compiled

The fork disappears .. Sometimes you need to manually compile it (right-click to compile it, or click the three green blocks in the debug status and apply code change ).

Only the top-level classes can be compiled, and the IDE will automatically perform hierarchical compilation ..

3. xml changes under Web. xml and web_inf
----------------------------------------------
After the XML file is modified, it is automatically updated to the compilation directory. However, the reload mechanism of Tomcat does not work... You need to manually reload... to enter the Tomcat Manager,

Manually reload the relative app to re-read the Web. xml configuration

4. Changes to hibernate. HBM. xml
--------------------------------------
HBM. XML is usually placed in the class directory. Generally, it automatically changes the updated... sometimes it cannot be updated automatically. You can apply code change in debug status or project

> Build... it will automatically reload. In rare cases, you need to manually reload ..
If the Hb configuration file is integrated in spring, because Ms is a one-time read, the normal direction must be manually reload before it takes effect ..

5. Spring and Struts configuration files **. xml
-------------------------------------------------
Although **. XML has been updated, it does not take effect because spring and Struts only read-only configuration files once and can only be manually reload ..

 

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.