File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Failed to initialize the ORB [Root exception is Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of C++ Concurrency this week in the C/C++ forum
or Spring Integration in Action in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "Failed to initialize the ORB [Root exception is" Watch "Failed to initialize the ORB [Root exception is" New topic
Author

Failed to initialize the ORB [Root exception is

sankar singh
Ranch Hand

Joined: Aug 17, 2007
Posts: 40
Hi,
Can anyone tell that what could be the problem?
javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.ClassCastException: com.sun.corba.se.impl.orb.ORBImpl]

my code:
stringctxfactory="com.ibm.websphere.naming.wsninitialcontextfactory";//[was]
stringserverurl="iiop://192.168.66.156:2809";//[was]
stringjndiname="gw_ejb_bean";
try
{
propertiesprop=newproperties();
prop.setproperty(context.initial_context_factory,ctxfactory);
prop.setproperty(context.provider_url,serverurl);
javax.naming.contextwlctx=newjavax.naming.initialcontext(prop);
system.out.println("thewlctx="+wlctx);
system.out.println("itslookingjndi,plswait");
objectnarrowfrom=wlctx.lookup(jndiname);
system.out.println("lookingjndiissuccessful,goahead");
}

catch(exceptione)
{
system.out.println("error:"+e.getmessage());
e.printstacktrace();
}
Venkateswara Rao Desu
Greenhorn

Joined: Apr 13, 2009
Posts: 6
This problem is due to using Sun JRE instead of IBM jre which comes with WebSphere installation.

Solution 1: Use IBM JRE
Solution 2: Keep the ibmorb.jar, which is available in IBM JRE to your CLASSPATH and also add following one more property in initial context properties
prop.setproperty("org.omg.CORBA.ORBClass", "com.ibm.CORBA.iiop.ORB");
Thats all you are done.


-- Venkateswara Rao Desu
 
 
subject: Failed to initialize the ORB [Root exception is
 
Two Laptop Bag

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture