Scheduler service accessing EJB breaks on hotdeployment
jeffbannister Aug 29, 2003 5:25 AMHi,
I have an application deployed as an EAR file that contains SAR file which creates a 'Scheduler' MBean.
This scheduler is accessing one of the EJBs deployed in the EAR file.
On initial startup of JBoss everything works OK, but when I hot deploy the EAR the scheduler MBean throws a 'ClassCastException' as follows....
12:04:30,031 ERROR [Scheduler$Listener] Handling a Scheduler call failed
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java
:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at com.beetleweed.bulkmail.ServiceLocator.getJobScheduler(ServiceLocator.java:284)
at com.beetleweed.bulkmail.scheduler.JobScheduler.perform(JobScheduler.java:60)
at org.jboss.varia.scheduler.Scheduler$Listener.handleNotification(Scheduler.java:1263)
at org.jboss.mx.server.NotificationListenerProxy.handleNotification(NotificationListenerProx
y.java:71)
at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterS
upport.java:97)
at javax.management.timer.Timer.sendNotifications(Timer.java:441)
at javax.management.timer.Timer.access$000(Timer.java:31)
at javax.management.timer.Timer$RegisteredNotification.doRun(Timer.java:612)
at org.jboss.mx.util.SchedulableRunnable.run(SchedulableRunnable.java:164)
at org.jboss.mx.util.ThreadPool$Worker.run(ThreadPool.java:225)
After looking through the forums I see other people with the same issue. One previous post also suggested a workaround of catching the ClassCastException and forcing a redeploy of the scheduler which I have tried and cannot get to work.
My SAR file in the EAR contains the following jboss-service.xml.....
jboss:service=Naming
jboss.j2ee:jndiName=JobScheduler,service=EJB
true
com.beetleweed.bulkmail.scheduler.JobScheduler
Schedulabe Test,12345
java.lang.String,int
0
@JOB_INTERVAL@
-1
I have tried depoying the SAR outside of the EAR and so on but cannot get passed this issue, hot deployment breaks the scheduler mbean.
Does anyone have an ideas how I could get round this? I am happy to change my packaging etc. if I'm doing something wrong.
regards,
Jeff.