[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Exception in thread "QuartzScheduler_Worker-6" java.lang.NoClassDefFoundError ???  XML
Forum Index -> Quartz
Author Message
kjayapau

neo

Joined: 07/19/2011 23:22:41
Messages: 9
Offline

Hi,

I have implemented quartz scheduler in our web application which is running in Tomcat 6. I am seeing the following error message when I shut down the tomcat.


Exception in thread "QuartzScheduler_Worker-6" java.lang.NoClassDefFoundError: o
rg/apache/log4j/spi/VectorWriter
at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:154)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.log(Category.java:853)
at org.slf4j.impl.Log4jLoggerAdapter.error(Log4jLoggerAdapter.java:571)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:560)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.spi.VectorWriter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1491)
... 5 more


I verified that lo4j, slf4j-api and slf4j-log4j jars are available on tomcat /web-inf/lib.

Any ideas? Why is it throwing this error?

Thanks in advance.

Regards,
kjayapau
light5

ophanim
[Avatar]
Joined: 01/14/2011 20:32:56
Messages: 554
Offline

Can you show your quartz config? How do you instantiate the scheduler object?

I use quartz in Tomcat and I do not have these problem. (http://code.google.com/p/myschedule)

If you have odd classloading rules, you may try turn on "org.quartz.scheduler
.threadsInheritContextClassLoaderOfInitializer=true" to see if it helps or not.

Zemian Deng
---------------
Looking for a web UI to manage Quartz?
Try http://code.google.com/p/myschedule
[WWW]
kjayapau

neo

Joined: 07/19/2011 23:22:41
Messages: 9
Offline

This is my quartz configuration.

<beans>
<bean id="quartzSchedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="dataSource">
<ref bean="ourApplicationDataSourceReference"/>
</property>
<property name="transactionManager">
<ref bean="ourApplicationTransactionManagerReference"/>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
<prop key="org.quartz.jobStore.maxMisfiresToHandleAtATime">10</prop>
<prop key="org.quartz.jobStore.class">org.springframework.scheduling.quartz.LocalDataSourceJobStore</prop>
<prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.oracle.OracleDelegate</prop>
<prop key="org.quartz.plugin.shutdownhook.class">org.quartz.plugins.management.ShutdownHookPlugin</prop>
<prop key="org.quartz.plugin.shutdownhook.cleanShutdown">true</prop>
<prop key="org.quartz.plugin.jobHistory.class">org.quartz.plugins.history.LoggingJobHistoryPlugin</prop>
<prop key="org.quartz.plugin.jobHistory.jobSuccessMessage">Job {1}.{0} fired at: {2, date, dd/MM/yyyy HH:mm:ss} result=OK</prop>
<prop key="org.quartz.plugin.jobHistory.jobFailedMessage">Job {1}.{0} fired at: {2, date, dd/MM/yyyy HH:mm:ss} result=ERROR</prop>
<prop key="org.quartz.plugin.triggHistory.class">org.quartz.plugins.history.LoggingTriggerHistoryPlugin</prop>
<prop key="org.quartz.plugin.triggHistory.triggerFiredMessage">Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss dd/MM/yyyy}</prop>
<prop key="org.quartz.plugin.triggHistory.triggerCompleteMessage">Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss dd/MM/yyyy} with resulting trigger instruction code: {9}</prop>
</props>
</property>
<property name="overwriteExistingJobs" value="true"/>
<property name="startupDelay" value="300"/>
<property name="applicationContextSchedulerContextKey"><value>applicationContext</value></property>
</bean>
</beans>
kjayapau

neo

Joined: 07/19/2011 23:22:41
Messages: 9
Offline

One more thing.. I am getting this error only when some jobs are running and i am shutting down the tomcat.
light5

ophanim
[Avatar]
Joined: 01/14/2011 20:32:56
Messages: 554
Offline

I am not too sure how you would get class not found exception yet, but one thing is for sure that you do not need the QuartzShutdown Plugin in Spring environment. The SchedulerFactoryBean will auto shutdown the scheduler for you if you configure normal Spring as dispatcher. You are doing that? If so try removing:

<prop key="org.quartz.plugin.shutdownhook.class">org.quartz.plugins.management.ShutdownHookPlugin</prop>
<prop key="org.quartz.plugin.shutdownhook.cleanShutdown">true</prop>

If you continue to have same problem, you can try print out full logging output here and see if that would shed some light. Which job is it executing when this happens, and can you post your job code? If you can you can also post your list content of your app.war/WEB-INF/lib listing here, along with your TOMCAT/common/lib listing. Just ensure you having the correct jar etc.

Zemian Deng
---------------
Looking for a web UI to manage Quartz?
Try http://code.google.com/p/myschedule
[WWW]
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team