Women in Technology

Hear us Roar



Article:
  Scheduling Jobs in a Java Web Application
Subject:   Problem with missing variables and classes
Date:   2009-05-04 20:46:07
From:   Phyo Phyo
Response to: Problem with missing variables and classes

I need help.


I'm new to struts application and also in scheduler.
Like you said in the article, I've combined the struts with quartz.
In my web.xml I have struts action servlet, my custom servelt and the quartz servlet.
These are the following.


<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>chainConfig</param-name>
<param-value>org/apache/struts/tiles/chain-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<servlet>
<servlet-name>initServlet</servlet-name>
<servlet-class>com.jit.igas3.servlet.SeInit</servlet-class>
<init-param>
<param-name>pathToConfig</param-name>
<param-value>config</param-value>
</init-param>
<init-param>
<param-name>pathToTemp</param-name>
<param-value>temp</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>QuartzInitializer</servlet-name>
<servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet </servlet-class>
<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>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>


load-on-startup of action is 1.
load-on-startup of initServlet is 2.
load-on-startup of QuartzInitializer is 3.


When I started the tomcat server, the value of factory is null.
StdSchedulerFactory factory = (StdSchedulerFactory)
ctx.getAttribute(QuartzInitializerServlet.QUARTZ_FACTORY_KEY);
when i call this statement.


So I change the load-on-startup of QuartzInitializer to 1, action to 2 and initServlet to 3.
Than the action is not working although the plugin is working.
It showing 404-Servlet action is not available.


Could you please help me to find out that problem?
and if possible I want to know the source of SchedulerPlugIn and DelayedSchedulerStarted.
Thanks and best regards.