• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TimerManager Problem

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to use TimerManager in our project. I was testing it on RAD6.0.1,
using DefaultTimerManager with JNDI name java/comp/env/tm/default.

However when I do lookup for that JNDI Name in a servlet it was giving error like this
Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is com.ibm.ws.asynchbeans.exception.AsynchBeanException: ASYN0069E: TimerManager java/comp/env/tm/default is being looked up without using resource reference.

The code in servlet for look up is
InitialContext ctx = new InitialContext();
TimerManager mgr = (TimerManager)
ctx.lookup(

java/comp/env/tm/default

);
I tried

java:comp/env/tm/default

, but that too gave error like javax.naming.NameNotFoundException: Name comp/env/tm not found in context "java:".

In web.xml corresponding resource reference entry is
<resource-ref>
<res-ref-name>tm/default</res-ref-name>
<res-type>commonj.timer.TimerManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
I tried giving the full JNDI Name in <res-ref-name> but it did not work.

Not able to find why the error is coming. Please help.

Regards,
Koms Alam
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<res-sharing-scope>Shareable</res-sharing-scope>

Make it non-sharable.

Also don't forget to add the entry to ibm specific binding file with the JNDI name.

<resRefBindings xmi:id="ResourceRefBinding_11111111111" jndiName="tm/default">
<bindingResourceRef href="WEB-INF/web.xml#ResourceRef_11111111111"/>
</resRefBindings>

Regards,
Ameer
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic