I’m trying to use an EJB inside a quartz InterruptableJob#execute method with a custom ServiceLocator, but, I get the following exception:
org.quartz.JobExecutionException: java.lang.ClassCastException: Cannot cast $Proxy450 to com.test.service.TestService [See nested exception: java.lang.ClassCastException: Cannot cast $Proxy450 to com.test.service.TestService]
at com.test.job.TestJob.execute(TestJob.java:107) [ecm-ejb.jar:]
at org.quartz.core.JobRunShell.run(JobRunShell.java:203) [quartz-1.5.2.jar:1.5.2]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) [quartz-1.5.2.jar:1.5.2]
What can I do do make EJB and Quartz play together?
Container: JBoss AS 7.1
Just managed it to work with some reflection and a ServiceLocator.