Spring Quartz performs two issues

Source: Internet
Author: User
Tags tomcat server

Resolves a problem where the quartz timed task was triggered two times:

Where <Host/> tells Tomcat to load all project files under WebApps at startup,<Context/> lets Tomcat reload again (typically configuration < Context/>, mainly due to the name of the domain access will be removed from the cause of the configuration, this situation will cause the project quartz timing is triggered two times, executed two times.

<Host/> change it to autodeploy= "false" deployonstartup= "false" to prevent the Quartz timer task from being triggered two times by booting from the Tomcat server. (Of course, it can be modified according to requirements, after all, the requirements of each project are different.) )

1. The Autodeploy property value is set to False, if this is set to True, indicates that the Tomcat service is running and can monitor the files under AppBase, and if a new Web application is added, it will be released from the Web application and set to False.

2. Add deployonstartup= "False", indicating that all Web apps under the AppBase directory will not be automatically published when the Tomcat server starts.

In this case, when Tomcat is started, the app under AppBase will not be automatically released and will not be automatically appbase under boot.

Of course, there is another way to configure the network:

is in <Context/> inside modify docbase Add "/webapps" path, of course, the project access path becomes http://localhost/eugeneqiu_test, see the project name is really uncomfortable, I will not use this method.

Fixed issue where quartz timed task was triggered two times

Method 1, by changing the configuration file of Tomcat Server.xml configuration

Method 2, first extract the quartz configuration information, stored separately as a file, such as Applicationcontext-quartz.xml and then modify the Web. XML, so that the website can be loaded when the container starts. (This article does not delve into this approach)

Spring Quartz performs two issues

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.