1 Reply Latest reply on May 10, 2002 2:23 PM by mitchell ackerman

    Scheduling an EJB Client...

    Benoit Xhenseval Newbie


      I wonder if I could tap into the forum knowledge...

      I would like to schedule a task which is in fact a CLIENT to my EJBs, i.e. it will need to call the EJB servers.

      I can see several issues in using the MBean Scheduler, please tell me if I'm wrong...

      1/ the CODE for the scheduled task and the client ejb classes will need to be in the JBoss/lib/ext
      2/ SOMEHOW the task will have to login in order to acquire a PrincipalCallerId. (How???, simple JAAS does not seem to work unlike a "normal" client)
      3/ How to schedule MORE than one task? I've fiddled with the jboss.jcml to enter the following as a SECOND scheduler:

      it works but complains at startup about:
      [INFO,Scheduler,JBossMain] JBoss Scheduler Service 'scheduler::server=Scheduler2' bound to scheduler::server=Scheduler2
      [ERROR,Default,JBossMain] javax.management.InstanceAlreadyExistsException: DefaultDomain:service=Timer

      Is it the best way to schedule such a task? Or is cron "easier".

      Any suggestions most welcome.



        • 1. Re: Scheduling an EJB Client...
          mitchell ackerman Newbie

          I have solved this problem by scheduling another mbean, which then uses JMS to kick of an ejb. this solved the problem whereby the code needs to be in lib/ext.

          secondly, the scheduler (2.4.4) doesn't work very well creating multiple instances (there are other problems too). i solved this by hacking the scheduler. if you want my hacked version let me know (mackerman@adcc.com). i can't say that all the bugs are out of it, but you can schedult multiple instances.