Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring + Quartz 2.2.0 Integration is Inconsistent [SPR-10775] #15401

Closed
spring-issuemaster opened this issue Jul 24, 2013 · 7 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Jul 24, 2013

sreekanth opened SPR-10775 and commented

There are a chain of problems in spring quartz integration. I'm really unsure some of the below mentioned error is spring problem or quartz problem.

I'm getting this error while using quartz-2.2.0 (even in 2.1.7) + Spring-3.2.3, which we where not facing before.

ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 50) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pgrSchedular' defined in ServletContext resource [/WEB-INF/applicationQuartzContext-pgr.xml]: Invocation of init method failed; nested exception is org.quartz.JobPersistenceException: Couldn't store trigger 'PGR_ESCALATION_TRIGGER_GROUP.PGR_ESCALATION_TRIGGER' for 'PGR_JOB_GROUP.PGR_ESCALATION_JOB' job:The job (PGR_JOB_GROUP.PGR_ESCALATION_JOB) referenced by the trigger does not exist. [See nested exception: org.quartz.JobPersistenceException: The job (PGR_JOB_GROUP.PGR_ESCALATION_JOB) referenced by the trigger does not exist.]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframewor

�[0m�[31m14:47:24,783 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 58) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pgrSchedular' defined in ServletContext resource [/WEB-INF/applicationQuartzContext-pgr.xml]: Cannot resolve reference to bean 'complaintEscalationCronTrigger' while setting bean property 'triggers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'complaintEscalationCronTrigger' defined in ServletContext resource [/WEB-INF/applicationQuartzContext-pgr.xml]: Cannot resolve reference to bean 'complaintEscalationJobDetail' while setting bean property 'jobDetail'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'complaintEscalationJobDetail' defined in ServletContext resource [/WEB-INF/applicationQuartzContext-pgr.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'requestsRecovery' of bean class [org.springframework.scheduling.quartz.JobDetailFactoryBean]: Bean property 'requestsRecovery' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]

Caused by: org.quartz.JobPersistenceException: Couldn't store trigger 'PGR_ESCALATION_TRIGGER_GROUP.PGR_ESCALATION_TRIGGER' for 'PGR_JOB_GROUP.PGR_ESCALATION_JOB' job:JobDataMap values must be Strings when the 'useProperties' property is set.  Key of offending value: jobDetail [See nested exception: java.io.IOException: JobDataMap values must be Strings when the 'useProperties' property is set.  Key of offending value: jobDetail]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1222) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport$4.execute(JobStoreSupport.java:1158) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport$45.execute(JobStoreSupport.java:3705) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:245) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInLock(JobStoreSupport.java:3701) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1154) [quartz-2.2.0.jar:]
	at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:962) [quartz-2.2.0.jar:]
	at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:258) [quartz-2.2.0.jar:]
	at org.springframework.scheduling.quartz.SchedulerAccessor.addTriggerToScheduler(SchedulerAccessor.java:371) [spring-context-support-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.scheduling.quartz.SchedulerAccessor.registerJobsAndTriggers(SchedulerAccessor.java:303) [spring-context-support-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:511) [spring-context-support-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	... 24 more
Caused by: java.io.IOException: JobDataMap values must be Strings when the 'useProperties' property is set.  Key of offending value: jobDetail
	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.convertToProperty(StdJDBCDelegate.java:3115) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.serializeProperties(StdJDBCDelegate.java:3082) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.serializeJobData(StdJDBCDelegate.java:3034) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.insertTrigger(StdJDBCDelegate.java:1045) [quartz-2.2.0.jar:]
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1219) [quartz-2.2.0.jar:]
	... 36 more
  1. FYI i'm using ojdbc6.jar
[31m17:26:10,949 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 57) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pgrSchedular' defined in ServletContext resource [/WEB-INF/applicationQuartzContext-pgr.xml]: Invocation of init method failed; nested exception is org.quartz.SchedulerException: Registration of jobs and triggers failed: oracle/sql/BLOB
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) [spring-context-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) [spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) [spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
	at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25]
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]
	at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
	at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.quartz.SchedulerException: Registration of jobs and triggers failed: oracle/sql/BLOB
	at org.springframework.scheduling.quartz.SchedulerAccessor.registerJobsAndTriggers(SchedulerAccessor.java:324) [spring-context-support-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:511) [spring-context-support-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479) [spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
	... 24 more

Attaching application bean xml for quartz.
Environment is JBoss AS 7 + Spring3.2.3 + Quartz2.2.0 + ubuntu


Affects: 3.2.3

Attachments:

Issue Links:

  • #13718 JobDetailFactoryBean missing properties to set description and durability on JobDetail
  • #15908 Full Quartz 2.2 compatibility, including LocalDataSourceJobStore

Referenced from: commits 2f8dfb3, dfac1d0, 676f7f9, f835188, d504d69, d5c78c9

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 27, 2013

sreekanth commented

The 4th problem is not a spring issue, its related to quartz OracleDelegate and Jboss AS7 module class loading. The problem i have resolved by specifying com.oracle.ojdb6 as a Dependency in MANIFEST.MF file. So kindly ignore the problem No 4.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 30, 2013

Juergen Hoeller commented

In the meantime, I've got straightforward solutions for no 2 and 3: In the case of 2, that property on JobDetailFactoryBean was simply missing. As for 3, we're removing that JobDetail object from the job data map after we've been evaluating it; so it shouldn't cause a problem with job persistence anymore.

However, I'm afraid I have no idea where no 1 comes from: Is it maybe a side effect of one of the other issues? I'll commit the fixes for no 2 and 3 today, so you'll have a chance to test the next 4.0.0 and 3.2.4 snapshots (to be available tonight). Let me know whether no 1 is still reproducible then.

Juergen

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 30, 2013

sreekanth commented

Sure and tons of thanks Juergen, i will test it and update it back here. Kindly reply back once snapshot is ready with download url.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 30, 2013

sreekanth commented

Hi Juergen,
Can you please reply with the snapshot download url.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 31, 2013

Juergen Hoeller commented

We were having issues with our 3.2.x build plan, but anyway, there is a snapshot of the spring-context-support module now that includes those recent Quartz support changes:

http://maven.springframework.org/snapshot/org/springframework/spring-context-support/3.2.4.BUILD-SNAPSHOT/

The latest currently is spring-context-support-3.2.4.BUILD-20130730.213843-18.jar but any newer one will work as well.

From a Maven POM, consider adding "http://maven.springframework.org/snapshot" as a repository URL, pointing to "3.2.4.BUILD-20130730.213843-18" as your Spring version number.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 31, 2013

sreekanth commented

Thanks, will update back when i have done with testing.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 31, 2013

sreekanth commented

All clear, all problems got resolved thanks a lot Juergen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.