How to modify the Java file. After saving the file, Tomcat cannot be restarted automatically

Source: Internet
Author: User

After the class file is modified, Tomcat cannot be restarted automatically. Manual restart cannot identify the changed class.

With the help of the project team lead, I found that Maven is not properly configured and some errors are still reported. So I just used the command, after MVN clean MVN package, the compilation error is modified, which is not found in the eclipse compiling environment.

Refresh again, clean and tomcat restart, and then modify the class file. This is the recovery from normal. The modified class file is automatically published to Tomcat and automatically restarted.

But it is still a null pointer error.

The reason is the code writing problem:

Correct code writing should be like this,
@ Resource (name = "activityservice ")
Private iactivityservice activityservice;
@ Resource (name = "partnerservice ")
Private ipartnerservice partnerservice;

@ Resource
Private webservicecontext context;

The original incorrect syntax is:

@ Resource
Private iactivityservice activityservice;
@ Resource
Private ipartnerservice partnerservice;

@ Resource
Private webservicecontext context;

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.