Groups > Weblogic > WebLogic JNDI > Access to TimeManager from Startup




Access to TimeManager from Startup

Access to TimeManager from Startup
Mon, 14 Apr 2008 07:52:56 -070
Hello,

I'm trying to start a commonj.timers.TimerManager from a startup class in
Weblogic 10, in a way like this:

[pre]InitialContext ic = new InitialContext();
   TimerManager tm =
(TimerManager)ic.lookup("java:comp/env/tm/TimerManager");
[/pre]

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):

[pre]<resource-ref>
   <res-ref-name>tm/TimerManager</res-ref-name>
   <res-type>commonj.timers.TimerManager</res-type>
   <res-auth>Container</res-auth>
   <res-sharing-scope>Unshareable</res-sharing-scope>
 </resource-ref>
[/pre]

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?

Post Reply
about | contact