我在QuartzScheduler初始化时遇到问题。
在AWS EC2中部署Java应用程序之后,我检查了unix日志框,发现以下错误。
Quartz Scheduler failed to initialize: org.quartz.SchedulerException: Properties file: 'quartz.properties' could not be read.
[See nested exception: java.io.FileNotFoundException: quartz.properties (No such file or directory)]
quartz.properties文件直接放置在项目根目录下,而不是任何文件夹下。
下面是web.xml
<servlet>
<servlet-name>EmailReportJobRescheduler</servlet-name>
<servlet-class>com.package.exceptiontracker.EmailReportJobRescheduler</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>EmailReportJobRescheduler</servlet-name>
<url-pattern>/EmailReportJobRescheduler</url-pattern>
</servlet-mapping>
<servlet>
<display-name>Quartz Initializer Servlet</display-name>
<servlet-name>QuartzInitializer</servlet-name>
<servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
<init-param>
<param-name>config-file</param-name>
<param-value>quartz.properties</param-value>
</init-param>
<init-param>
<param-name>shutdown-on-unload</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>start-scheduler-on-load</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
同一应用程序在Weblogic中部署时可以工作,但是在云中部署时会显示上述错误。有人知道为什么吗?