1 Reply Latest reply on Apr 15, 2008 10:19 AM by 666705

    Access to TimeManager from Startup


      I'm trying to start a commonj.timers.TimerManager from a startup class in Weblogic 10, in a way like this:
      InitialContext ic = new InitialContext();
         TimerManager tm = (TimerManager)ic.lookup("java:comp/env/tm/TimerManager");
      I've added the jar file where my class is included to the CLASSPATH.

      The problem is that all the samples that I see for this matter need a resource-ref that is only available in WAR or EJB apps (not JAR):
      The error that I got from it is that the startup does not finds the object through the JNDI tree...

      So my question is: is it possible to execute any timer from a Startup class? Is there any way or I have to put it in a WAR or EJB app, because there's no other way to access to it through JNDI?

        • 1. Re: Access to TimeManager from Startup

          I solved this matter creating a Timer Service MBean in the startup class:


          Now I've a listener that receives notifications every X seconds since the server starts up: I don't need commonj package at all.


          Edited by vicente.tarrazona@consors.es at 04/15/2008 3:19 AM