[jboss-user] [JNDI/Naming/Network] - Re: NameNotBoundException in MDB, but bound in WAR Servlet

jaikiran do-not-reply at jboss.com
Tue Aug 12 04:31:37 EDT 2008


anonymous wrote : In a WAR, I am loading a servlet during application startup to bootstrap some configuration within an object then binding that object to the JNDI java:comp/env namespace.
  | 
  | When I look in the jmx-console, I see that the object is available under the following heading:
  | 
  | java:comp namespace of the my-ear.ear/my-war.war application. 

When you add the object to the java:comp/env namespace of the WAR, it becomes available to your WAR component. Each component in your application have their own java:comp/env namespace (environment naming context - ENC). When you try to lookup this object from the MDB (which has a different ENC), the MDB will not be able to find this since it looks in its own ENC. To make the object available in the ENC of the MDB, you will have to add a resource-ref in the ejb-jar.xml of this bean, to point to the object that you have bound in the jndi tree.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170022#4170022

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170022



More information about the jboss-user mailing list