In the Web.xml I have:
<resource-ref>
<res-ref-name>java:/comp/env/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>
In the java code I have:
TimerManager tm = (TimerManager) ic.lookup("tm/TimerManager");
tm.schedule(new CleanupListener(), 0, 10*1000); // CleanupListener class is my TimerListener
So when I run the code, the Timer kick in successfully but right after the code crash with the following exception:
javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: java
I have no idea why.
when I change the lookup with this: TimerManager tm = (TimerManager) ic.lookup("java:/comp/env/tm/TimerManager");
This is even worst, the Timer never kick in and I do have this following exception:
db.common.util.ServiceLocatorException: javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: java
Please help, very important. Thanks