1 Reply Latest reply on Mar 2, 2004 7:13 PM by oldblue

    Help!  Can't get scheduler working!

    oldblue

      I'm trying to set up a scheduled task and I've read all the various docs I can find and I'm still having a problem. I'm running JBoss 3.2.2. When I start up JBoss I get the following:

      14:51:17,487 WARN [ServiceConfigurator] Failed to complete install
      java.lang.ClassNotFoundException: Unexpected error during load of: org.jboss.varia.scheduler.Scheduler, msg=org/jboss/system/ServiceMBeanSupport at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:218)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:123)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      .
      . (I edited this to save space.)
      .
      at org.jboss.Main$1.run(Main.java:395)
      at java.lang.Thread.run(Thread.java:534)
      14:51:17,507 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.2.2/server/trif/deploy/scheduler-service.xml
      org.jboss.deployment.DeploymentException: create operation failed for package file:/C:/jboss-3.2.2/server/trif/deploy/scheduler-service.xml; - nested throwable: (javax.management.InstanceNotFoundException: TradeRanger:service=Scheduler is not registered.)
      at org.jboss.deployment.SARDeployer.create(SARDeployer.java:202)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
      .
      .(I edited this to save space.)
      .
      at org.jboss.Main.boot(Main.java:150)
      at org.jboss.Main$1.run(Main.java:395)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: javax.management.InstanceNotFoundException: TradeRanger:service=Scheduler is not registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:354)
      at org.jboss.mx.server.MBeanServerImpl.getMBeanInfo(MBeanServerImpl.java:557)
      at org.jboss.system.ServiceController.getServiceProxy(ServiceController.java:745)
      .
      .(I edited this to save space.)
      .
      14:51:34,382 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:
      [org.jboss.deployment.DeploymentInfo@5bcd08fa { url=file:/C:/jboss-3.2.2/server/trif/deploy/scheduler-service.xml }
      deployer: org.jboss.deployment.SARDeployer@12a0f6c
      status: Deployment FAILED reason: create operation failed for package file:/C:/jboss-3.2.2/server/trif/deploy/scheduler-service.xml; - nested throwable: (javax.management.InstanceNotFoundException: TradeRanger:service=Scheduler is not registered.)
      state: FAILED
      watch: file:/C:/jboss-3.2.2/server/trif/deploy/scheduler-service.xml
      lastDeployed: 1078260677477
      lastModified: 1078260677467
      mbeans:
      TradeRanger:service=Scheduler (state not available)
      ]MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: TradeRanger:service=Scheduler
      state: NOTYETINSTALLED


      I've added the scheduler-plugin.jar to my classpath. My class implements org.jboss.varia.scheduler.Schedulable, and has a perform() method. The constructor has no arguments. It is in a jar file that is in the deploy directory and is specified in the classpath. I have a scheduler-service.xml as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
       <mbean code="org.jboss.varia.scheduler.Scheduler" name="TradeRanger:service=Scheduler">
       <attribute name="StartAtStartup">true</attribute>
       <attribute name="SchedulableClass">com.tr.infrastructure.connectors.pollers.C1Connector</attribute>
       <attribute name="InitialStartDate">NOW</attribute>
       <attribute name="SchedulePeriod">300000</attribute>
       <attribute name="InitialRepetitions">-1</attribute>
       </mbean>
      </server>
      


      Could someone help me figure out what I'm doing wrong?

        • 1. Re: Help!  Can't get scheduler working!
          oldblue

          It seems that having scheduler-plugin.jar in my classpath was causing the error message shown. I fixed that and then it couldn't find the class I was trying to schedule:

          18:31:52,958 INFO [Scheduler] Failed to find: com.tr.infrastructure.connectors.pollers.C1Connector
          java.lang.ClassNotFoundException: Unexpected error during load of: com.tr.infrastructure.connectors.pollers.C1Connector, msg=org/jboss/varia/scheduler/Schedulable

          C1Connector is my schedulable class. It was in a jar file in the deploy directory. I couldn't find a way to specify to the scheduler that it needed to find that class in that jar.

          So... I decided to move the jar into the lib directory instead. This fixed my problem and I don't have to specify that jar in my classpath for other services that need classes in there. What an aggravation this was. But now it's done. Whew!