2 Replies Latest reply on Sep 2, 2003 6:02 AM by jeffbannister

    Scheduler service accessing EJB breaks on hotdeployment

    jeffbannister

      Hi,

      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.

        • 1. Re: Scheduler service accessing EJB breaks on hotdeployment

          1) Where is your servicelocator deployed, does it still
          remember the old class?
          2) Do you have a jndi.properties in your deployment,
          remove it?
          3) There is a further workaround for java 1.4
          RMI Classloader caching in jboss-3.2.2RC3
          test it with that version to see if it the same problem.

          Regards,
          Adrian

          • 2. Re: Scheduler service accessing EJB breaks on hotdeployment
            jeffbannister

            Thanks Adrian for you reply,

            FYI...

            1) The ServiceLocator class is deployed in an ejb-client.jar file contained within the EAR file. Any component i.e. a web or EJB uses the jar extension mechanism to refer to this jar file located at the root of the EAR file.
            2) I do indeed have a jndi.properties file contained in the SAR file in the EAR file as follows...

            bulkmail.ear
            bulkmail-scheduler.sar
            bulkmail-scheduler.jar
            jndi.properties.

            I will remove it and see what happens.

            3) I have tried with JBoss3.2.2RC3 and got more errors than before. I will test again and foward for findings.

            thanks,

            Jeff.