4 Replies Latest reply on Jan 9, 2002 6:28 PM by sridhar mandava

    Scheduler Confusion

    sridhar mandava Newbie

      Hi,

      I am writing to use the JBOSS scheduler service MBean.

      I have copied the SchedulableExample to one of my package for example : com.xjz.SchedulableExample
      and added












      to jboss.jcml. When I started JBoss everything was OK.

      But when I created a new file com.xyz.ScheduledDataRemover with the same code as the jboss example and added




      <!---->









      and start JBoss I am getting this Exception

      [Configuration] Could not create MBean :service=ScheduledDataRemover(org.jboss.u
      til.Scheduler)
      [Configuration] java.security.InvalidParameterException: Given class com.proflue
      nt.manager.common.ScheduledDataRemover is not valid or not found
      [Configuration] at org.jboss.util.Scheduler.setSchedulableClass(Schedule
      r.java:351)
      [Configuration] at org.jboss.util.Scheduler.(Scheduler.java:120)
      [Configuration] at java.lang.reflect.Constructor.newInstance(Native Meth
      od)
      [Configuration] at com.sun.management.jmx.MBeanServerImpl.internal_insta
      ntiate(MBeanServerImpl.java:2210)
      [Configuration] at com.sun.management.jmx.MBeanServerImpl.createMBean(MB
      eanServerImpl.java:761)
      [Configuration] at org.jboss.configuration.ConfigurationService.create(C
      onfigurationService.java:579)
      [Configuration] at org.jboss.configuration.ConfigurationService.loadConf
      iguration(ConfigurationService.java:381)
      [Configuration] at java.lang.reflect.Method.invoke(Native Method)
      [Configuration] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
      rverImpl.java:1628)
      [Configuration] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
      rverImpl.java:1523)
      [Configuration] at org.jboss.Main.(Main.java:213)
      [Configuration] at org.jboss.Main$1.run(Main.java:127)
      [Configuration] at java.security.AccessController.doPrivileged(Native Me
      thod)
      [Configuration] at org.jboss.Main.main(Main.java:123)
      [Jetty] set JettyHome to ../../jetty

      ----------
      I exactly don't know wahts going on.
      I have tried both these cases.
      <!---->



      Can anybody help me solve this problem.

      thanks in advance.

      -Sridhar Mandava

        • 1. Re: Scheduler Confusion
          Adrian Brock Master

          Didn't you already post this as
          Scheduler not working
          I answered it there.

          Regards,
          Adrian

          • 2. Re: Scheduler Confusion
            sridhar mandava Newbie

            I have tried ur fix.I have changed it to fully qualified classpath.Its not working.
            I have the same code for both the classes(ScheduledDataRemover and SchedulableExample).but I don't know one works and one doesn't work.
            ----------ScheduledDataRemover-----------
            import org.jboss.util.Schedulable;
            import java.util.Date;

            public class ScheduledDataRemover
            implements Schedulable
            {
            private String mName;
            private int mValue;

            public ScheduledDataRemover(
            String pName,
            int pValue
            ) {
            mName = pName;
            mValue = pValue;
            }

            /**
            * Just log the call
            **/
            public void perform(Date pTimeOfCall,long pRemainingRepetitions)
            {

            System.out.println( "------------ScheduledDataRemover is called at: " + pTimeOfCall +
            ", remaining repetitions: " + pRemainingRepetitions +
            ", test, name: " + mName + ", value: " + mValue );
            }
            }
            -----------------------

            help me if I have any bug in my code..

            my mbean element is














            The error message I am getting is--->

            [Configuration] Could not create MBean :service=Scheduler(org.jboss.util.Schedul
            er)
            [Configuration] java.security.InvalidParameterException: Given class com.proflue
            nt.manager.common.ScheduledDataRemover is not valid or not found
            [Configuration] at org.jboss.util.Scheduler.setSchedulableClass(Schedule
            r.java:351)
            [Configuration] at org.jboss.util.Scheduler.(Scheduler.java:120)
            [Configuration] at java.lang.reflect.Constructor.newInstance(Native Meth
            od)
            [Configuration] at com.sun.management.jmx.MBeanServerImpl.internal_insta
            ntiate(MBeanServerImpl.java:2210)
            [Configuration] at com.sun.management.jmx.MBeanServerImpl.createMBean(MB
            eanServerImpl.java:761)
            [Configuration] at org.jboss.configuration.ConfigurationService.create(C
            onfigurationService.java:579)
            [Configuration] at org.jboss.configuration.ConfigurationService.loadConf
            iguration(ConfigurationService.java:381)
            [Configuration] at java.lang.reflect.Method.invoke(Native Method)
            [Configuration] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
            rverImpl.java:1628)
            [Configuration] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanSe
            rverImpl.java:1523)
            [Configuration] at org.jboss.Main.(Main.java:213)
            [Configuration] at org.jboss.Main$1.run(Main.java:127)
            [Configuration] at java.security.AccessController.doPrivileged(Native Me
            thod)
            [Configuration] at org.jboss.Main.main(Main.java:123)


            I clearly don't know whats going on..

            Thanks in advance.

            -Sridhar Mandava.

            • 3. Re: Scheduler Confusion
              Adrian Brock Master

              Have you put your class into a jar and added it to
              $JBOSS_HOME/lib/ext?

              You'll need to restart the server on 2.4

              With 3.0 you can hot-deploy services :-)

              Regards,
              Adrian

              • 4. Re: Scheduler Confusion
                sridhar mandava Newbie

                Thank U Adrian.
                My env got messsed up..Anyway that helps me to solve the problem.