0 Replies Latest reply on Aug 13, 2007 9:46 AM by Alex Medina

    Not possible to deploy a Schedulable Implementation in an .e

    Alex Medina Newbie


      i'm trying to deploy an Implementation of the Schedulable-Interface in an .ear-file which contains my whole application. I've added the following lines to the scheduler-service.xml file:

       <mbean code="org.jboss.varia.scheduler.Scheduler"
       <attribute name="StartAtStartup">true</attribute>
       <attribute name="SchedulableClass">com.offix.middleware.scheduler.CacheCleaner</attribute>
       <attribute name="InitialStartDate">1/1/07 0:00 p</attribute>
       <attribute name="SchedulePeriod">1800000</attribute>
       <attribute name="InitialRepetitions">-1</attribute>

      On jboss start, i get a ClassNotFoundException for my implementation-class, because the Scheduler-MBean starts, before the .ear gets deployed. This causes the Scheduler not to start at all.

      Unfortunately, it's necessary to deploy the Schedulable-implementation with the application, cause we're using some variables, which are defined in there(i.e. JBossCache-parameters).

      I've seen that there is a flag "startOnStartup", but how can i invoke the startSchedule operation of the mbean? It would be very convenient to do that automatically after the deployment of the .ear and not have to invoke the operation by hand, everytime we reboot the jboss. Is that possible?

      Thanks in advance,