Disregard, somehow i got 2 versions of the quartz jar in the lib folder. it's working now.
I'm working to upgrade an interface that use to use Quartz 1.7.3 to 2.2.2
I worked out the compile issues but now I'm getting startup errors which i believe is localized to problems in the context file but I'm unsure of what's wrong.
The error appears to be with defining the scheduler and trigger.
Error:
INFO | jvm 1 | 2018/06/26 09:24:41 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'intAppService' defined in file [E:\Southern\Apps\INTG\PRDEL\PRDEL01\config\PRdelApp-context.xml]:
Cannot resolve reference to bean 'quartzScheduler' while setting bean property 'quartzScheduler'; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'quartzScheduler' defined in file [E:\Southern\Apps\INTG\PRDEL\PRDEL01\config\PRdelApp-context.xml]: Cannot resolve reference to bean 'cronTrigger' while setting bean property 'triggers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'cronTrigger' defined in file [E:\Southern\Apps\INTG\PRDEL\PRDEL01\config\PRdelApp-context.xml]: Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
Context:
<?xml version="1.0" encoding="UTF-8"?>
<!--Application context definitions for DispatcherServlet.-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
default-autowire="no" >
<!-- ========================= GENERAL DEFINITIONS ========================= -->
<!-- Enable load-time weaving for instrumentation. -->
<!-- Remove in later versions of spring -->
<!-- <context:load-time-weaver/> -->
<!-- Configurer that replaces ${...} placeholders with values from properties files -->
<bean id="propertyConfigurer" class="com.southerncompany.primavera.common.spring.PrimaveraNestedPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>file:config/application.properties</value>
</list>
</property>
<property name="nestedLocations">
<list>
<value>${app.config.db}/primavera.properties</value>
</list>
</property>
<property name="bootstrapHomePropertyName" value="primavera.bootstrap.home"/>
<property name="bootstrapFolder" value="${app.primavera.bootstrap.folder}"/>
<property name="bootstrapConfiguration" value="${primavera.configuration}"/>
</bean>
<bean id="applicationVersion" class="java.lang.String">
<constructor-arg type="java.lang.String" value="${app.version}"/>
</bean>
<!-- =============================== DOMAIN ============================ -->
<bean name="intAppService" class="com.southerncompany.primavera.prdel.QuartzTaskScheduler" init-method="listen">
<property name="name" value="PvJobListener" />
<property name="quartzScheduler" ref="quartzScheduler"/>
</bean>
<bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="autoStartup" value="false" />
<property name="schedulerName" value="PvScheduler" />
<property name="triggers">
<list>
<ref bean="cronTrigger" />
</list>
</property>
</bean>
<bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="serviceTask" />
<property name="targetMethod" value="run" />
<property name="concurrent" value="false" />
<property name="group" value="PV" />
<property name="name" value="${app.service.name}${app.service.instance}-Job" />
<!--<property name="jobListenerNames">
<list>
<value>PvJobListener</value>
</list>
</property>-->
</bean>
<bean name="serviceTask" class="com.southerncompany.primavera.prdel.ProjDeleteService">
<property name="serviceTaskName" value="${app.service.name}${app.service.instance}"/>
<property name="primaveraSessionService" ref="primaveraSessionService"/>
</bean>
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="jobDetail" />
<!--property name="cronExpression" value="10 0/01 * * * ?" /-->
<!-- run every 5 mins -->
<property name="cronExpression" value="0 0/5 * * * ?" />
<!-- run twice a day at 3am and 3pm -->
<!-- <property name="cronExpression" value="0 0 2,15 ? * *" /> -->
<!-- run every 30 minutes, at 10 seconds after the minute (i.e. 10:00:10 am, 10:30:10 am, etc.) -->
<!--property name="cronExpression" value="10 0/30 * * * ?" /> -->
</bean>
<!-- Application shutdown even listeners. Externally loaded by main class. -->
<bean id="serviceStopEventListeners" class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList">
<list>
</list>
</property>
</bean>
<bean id="primaveraSessionService" class="com.southerncompany.primavera.common.primavera.ApiSessionService" init-method="login">
<property name="bootstrapKey" value="primavera.bootstrap.home" />
<property name="bootstrapHome" value="${primavera.bootstrap.home}" />
<property name="autoLoginDatabaseName" value="${primavera.login.databaseName}" />
<property name="autoLoginUserName" value="${app.primavera.login.userid}" />
<property name="autoLoginPassword" value="${app.primavera.login.password}" />
</bean>
Sounds like an out of date version of CronTriggerFactoryBean
in Spring - a similar question .
Quartz 2 changed org.quartz.CronTrigger
from a class to an interface, so you do need a compatible version of CronTriggerFactoryBean
. I would check what version(s) of spring-context-support.jar
are in the .war
file, on the classpath, etc.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.