Search code examples
websphere

Jar file for com.ibm.websphere.naming.WsnInitialContextFactory


I'm trying to connect to Websphere 8.0 (WAS)

I get exception

Exception occurred: javax.naming.NoInitialContextException: Cannot instantiate      
class:com.ibm.websphere.naming.WsnInitialContextFactory

when running my program.

my jndi.properties is

java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory
java.naming.factory.url.pkgs=com.ibm.ws.naming
java.naming.provider.url=iiop://<myip>:2810

May I know which jar should we use so that can connect successfully?


Solution

  • You certainly need the WAS_ROOT/runtimes/com.ibm.ws.ejb.thinclient_8.0.0.jar in your classpath, where WAS_ROOT is the installation home of your WAS.