IntelliJ Java IDE
The moose likes Websphere and the fly likes Error in getting Initial context Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "Error in getting Initial context" Watch "Error in getting Initial context" New topic
Author

Error in getting Initial context

Parul Dholakia
Greenhorn

Joined: Jul 03, 2001
Posts: 16
Hi,
I am trying to get the initial context and I have written this piece of code.
This works fine with Websphere APplication server installed on NT but wheb I try to connect to Websphere APplication server installed on Solaris, It fails, and the error
returned is..
javax.naming.CommunicationException. Root exception is org.omg.CORBA.COMM_FAILURE: minor code: 1 completed: No
any help please..
The code I ahve written is :
properties.put(Context.PROVIDER_URL,"iiop://"+strHostName+":"+strPort);
properties.put(Context.INITIAL_CONTEXT_FACTORY,com.ibm.ejs.ns.jndi.CNInitialContextFactory);
ic = new InitialContext(properties);

thanks in advance.
Balbir Singh
Ranch Hand

Joined: Jun 01, 2001
Posts: 79
give initial context factory parameter as a string
Properties.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
also include rmiorb.jar and iioprt.jar in ur classpath
i hope this helps


Thanks and Regards<br />Balbir Singh<br />Sun Certified Java Programmer<br />IBM Certified Administrator for WebSphere4.0
Parul Dholakia
Greenhorn

Joined: Jul 03, 2001
Posts: 16
Thanks a lot, it worked.
 
 
subject: Error in getting Initial context
 
Threads others viewed
JNDI error
NamingException
websphere ejb context
EJB client for Websphere throws ClassCastException
@EJB REMOTE
developer file tools