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

QuartzJobBean doesn't work with Quartz 2.0 at runtime [SPR-8889] #13530

Closed
spring-issuemaster opened this Issue Nov 30, 2011 · 10 comments

Comments

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

spring-issuemaster commented Nov 30, 2011

Steve Storey opened SPR-8889 and commented

Having put RC2 to work and testing out the fix for #13418 I now realise there's another problem. When the job I configured fires, I get the following exception2011-11-30 23:30:00,073 ERROR [JobRunShell] Job DEFAULT.job.reload.profiles threw an unhandled Exception:
java.lang.IncompatibleClassChangeError: Found interface org.quartz.JobExecutionContext, but class was expected
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:79)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
2011-11-30 23:30:00,075 ERROR [ErrorLogger] Job (DEFAULT.job.reload.profiles threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IncompatibleClassChangeError: Found interface org.quartz.JobExecutionContext, but class was expected]
at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.quartz.JobExecutionContext, but class was expected
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:79)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
... 1 more

Configuration for the job is:<bean id="profileService.schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<bean class="org.quartz.impl.triggers.CronTriggerImpl">
<property name="name" value="job.reload.profiles.trigger" />
<property name="jobName" value="job.reload.profiles"/>
<property name="jobGroup" value="DEFAULT" />

<!-- run every 10 mins -->
<property name="cronExpression" value="0 0,10,20,30,40,50 * * * ?" />
</bean>
</list>
</property>
<property name="jobDetails">
<list>
<bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="profileService"/>
<property name="targetMethod" value="reloadProfiles"/>
<property name="concurrent" value="false"/>
<property name="name" value="job.reload.profiles"/>
<property name="group" value="DEFAULT" />
</bean>
</list>
</property>
</bean>
I assume that this is a build issue for the Spring framework? Will there need to be a separate package and so on for Quartz 2, like Hibernate4


Affects: 3.1 RC2

Attachments:

Issue Links:

  • #13528 QuartzJobBean throws IncompatibleClassChangeError when using Quartz 2.x ("is duplicated by")

Referenced from: commits 4831ca2, 9506f8d, 2b12281, 00ff8fa

1 votes, 4 watchers

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 30, 2011

Steve Storey commented

Incidentally, I don't get this problem when I've rolled my own MethodInvokingJobDetailFactoryBean as a copy and paste of the original but built against Quartz 2.0, but I don't really understand why since I don't recompile the QuartzJobBean.

I'm attaching my home-rolled version (only created to tide me over until RC2 was released) to help with the debugging

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 30, 2011

Steve Storey commented

And I now realise that I'm in fact using Quartz 2.1.1, but I believe that this problem also exists with Quartz 2.0 as well

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Dec 1, 2011

Juergen Hoeller commented

Good catch! Unfortunately we only tested the Spring 3.1 RC2 binaries against Quartz 2.0 in combination with regular Job implementations. As of Spring 3.1 GA, QuartzJobBean subclasses will work fine with Quartz 2.0/2.1 as well.

Juergen

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Dec 15, 2011

Vecchio Fabrizio commented

Unfortunately i run in the same problem, but i'm using spring 3.1.0.RELEASE (same error for quartz 2.0.2, 2.1.0, 2.1.1)

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Dec 15, 2011

Steve Storey commented

Agreed. This isn't fixed by 3.1GA I'm afraid.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Dec 21, 2011

Juergen Hoeller commented

Ouch. Seems we even need to do the getMethod calls against a reflectively loaded Class. Fixed for 3.1.1.

Juergen

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Feb 13, 2012

Jake Brownell commented

Using the 3.1.1.BUILD-SNAPSHOT sourced from artifactory, I am seeing what appears to be a similar error:

Feb 13, 2012 3:36:41 AM org.quartz.core.ErrorLogger schedulerError
SEVERE: Job (DEFAULT.task$child#16d46d7 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IncompatibleClassChangeError: Found interface org.quartz.JobExecutionContext, but class was expected]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.quartz.JobExecutionContext, but class was expected
	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:299)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
	... 1 more
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Feb 14, 2012

Max Ullinger commented

This seems to be a pretty serious bug.

We are itching to perform a library update and aimed for last Monday (as that was the projected date for 3.1.1 and this fix).
Now the release of 3.1.1 was pushed back and the error might not be fixed after all?

Is there a workaround?
It would be bad for us to wait for the merge/upgrade only because of this bug

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Feb 14, 2012

Max Ullinger commented

Just wanted to add that I also tried out spring-context-support-3.1.1.BUILD-20120213.152903-50.jar which should include the fix, and the same exception still occurs for us (so no point in pasting the stacktrace as well)

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Feb 14, 2012

Juergen Hoeller commented

Note that this issue originally is about QuartzJobBean which has been fixed before. The newly reported case is about MethodInvokingJobDetailFactoryBean which indeed does have a similar issue. I've just fixed that one for 3.1.1 as well; this will show up in the repo in a few minutes.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment