views:

126

answers:

2

How do you know how to form a JNDI string? I know there must be a format and that the divisions must mean something but I haven't been able to find a good resource that explains them. For example: java:comp/env/wm/default. This is supposed to connect to a WorkManager in Websphere with the name of default. But what does the "java", "comp", "env" mean? I know what the wm/default mean because that's the JNDI name put in the WorkManager, but what does the rest mean?

Thanks

+2  A: 

The "java:" scheme was introduced in J2EE for accessing process-local data. The "comp" context is short for "component"; it contains data that is local to the J2EE component (web module or EJB type) that is active on the current thread. The "env" subcontext is short for "environment"; it is the context under which EJB references, resource references, and environment entries are bound. The "wm/default" is an arbitrary name. The "wm" subcontext name is the convention for work managers, but the full name could have also been "java:comp/env/myDefaultWM", where web.xml/ejb-jar.xml defined a resource-ref with <res-ref-name>myDefaultWM<res-ref-name>.

bkail