Hi,
I have
EJB deployed on Websphere 7.0 and have written a client to
test it. But when I am running the client code I am getting error. Please find below the code of the client:
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
props.put(Context.PROVIDER_URL,"iiop://localhost:9100");//ORB listner port is 9100
Context ctx = new InitialContext(props);
Object obj = ctx.lookup("MyEJBService");
RemoteHome obj1 = (RemoteHome)PortableRemoteObject.narrow(obj,RemoteHome.class);
Remote obj2 = obj1.create();
I am getting following error:
javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.ClassCastException: com.sun.corba.se.impl.orb.ORBImpl cannot be cast to com.ibm.CORBA.iiop.ORB]
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:318)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:400)
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(InitialContext.java:392)
at com.amdocs.iadmin.user.TestEJb.testUserLoad(TestEJb.java:49)
at com.amdocs.iadmin.user.TestEJb.main(TestEJb.java:27)
Caused by: java.lang.ClassCastException: com.sun.corba.se.impl.orb.ORBImpl cannot be cast to com.ibm.CORBA.iiop.ORB
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)
... 7 more
Can someone please help me regarding this.