INITIAL_CONTEXT_FACTORYPROVIDER_URLURL_PKG_PREFIXESComment
JBoss 3.0.7 JRun 4.0 Sun One 7.0 Weblogic 7.0 WebSphere 5.0 WebSphere 5.0 alternate WebSphere 5.0 multiple addresses WebSphere 5.0 from non-WebSphere environmentorg.jnp.interfaces.NamingContextFactory jrun.naming.JRunContextFactory com.sun.jndi.cosnaming.CNCtxFactory weblogic.jndi.WLInitialContextFactory com.ibm.websphere.naming.WsnInitialContextFactory com.ibm.websphere.naming.WsnInitialContextFactory com.ibm.websphere.naming.WsnInitialContextFactory com.someone.else.naming.AnotherInitialContextFactoryhost
jnp://host:1099 host:2909 iiop://host:3700 t3://host:7001 iiop://host:2809/ corbaloc:iiop:host:2809 corbaloc::host1:2809,:host2:2809,:host3:2809 corbaname:iiop:host:2809/NameServiceServerRoot
org.jboss.naming:org.jnp.interfaces

jndi.properties examples

Make sure intended jndi.properties file is the first one to be found on the classpath. Default versions are very likely to be in jar files on your classpath.

JBoss

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost

WebSphere

java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory
java.naming.provider.url=iiop://localhost:2809

WebSphere Note: You probably need to use a host name rather than an IP address. Whilst you can use an IP address to hit the server, somewhere along the line the client seems to retrieve and attempt to use the host name from the name server. I guess you need to either alter the name server configuration to use IP address or change your client environment so that it can resolve the host name. (Update DNS entry, or add to you hosts file).

To see what port WebSphere Application Server 5 is listening on, go to the adminstrative console and select 'Application Servers -> server1 -> End Points -> BOOTSTRAP_ADDRESS'.

Tomcat

As at the time of writing, it is not possible to directly access Tomcat's JNDI properties from outside of Tomcat.

-- Frank Dean - 28 Feb 2008


-- Frank Dean - 02 Sep 2003