Hi,
I am getting ClassCastException error while executing the following code. It is happening just after the execution of
lookup method. Please help me out:
Console Output:
Success!
javax.naming.InitialContext@18a47e0
Exception in
thread "main" javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.ClassCastException: com.sun.corba.se.impl.orb.ORBImpl]
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:318)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:392)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:117)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:712)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:171)
at javax.naming.InitialContext.lookup(Unknown Source)
at testInitialContext.main(testInitialContext.java:20)
Caused by: java.lang.ClassCastException: com.sun.corba.se.impl.orb.ORBImpl
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:86)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:179)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:83)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:59)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:102)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:309)
... 6 more
I have included ibmorb.jar and ws_runtime.jar in the eclipse.