JNDI syntaxe using Lookup
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ghislain_Bergeron
Posted On:   Monday, May 5, 2003 06:55 PM

Hi,

Why using ctx.lookup("jdbc/oracle") works in IBP Websphere but not in Tomcat. I have to use the command ctx.lookup("java:/comp/env/jdbc/oracle") in Tomcat to make it work?

Thanks!

Ghislain

Re: JNDI syntaxe using Lookup

Posted By:   Nicholas_Whitehead  
Posted On:   Wednesday, May 7, 2003 06:45 AM

Ghislain;

When you say that you can look up "jdbc/oracle", I assume you mean from an EJB ?

If so, the difference may be attributable to the fact that when performing a lookup from an EJB in a conforming J2EE server, it is implicit that your current context is java:/comp/env, therefore, the correct relative name from that context would be jdbc/oracle. Tomcat, on the other hand, does not have an EJB context as such, since it does not have an EJB container, so it requires a fully qualified name.

It may also be attributable to minor differences in the implementation of the J2EE specification, but you shoudl find that java:/comp/env/jdbc/oracle is universally applicable for application servers that are fully compliant and applications that have been deployed in a compliant manner.

//Nicholas

About | Sitemap | Contact