aspose file tools*
The moose likes Websphere and the fly likes Standalone java client to lookup ejb in websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Standalone java client to lookup ejb in websphere" Watch "Standalone java client to lookup ejb in websphere" New topic
Author

Standalone java client to lookup ejb in websphere

ramjcp kris
Greenhorn

Joined: Sep 05, 2005
Posts: 27
Hi All,

my code is


I have added all those necessary jar files to classpath like - wssec.jar, naming.jar, namingclient.jar, lmproxy.jar,sas.jar and ecutils.jar still facing same problem

I am getting the following Exception when executing the code (Object obj = ctx.lookup("/Hello") in SUN JRE

Exception is

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(InitialContext.java:351)
at TestHello.main(TestHello.java:26)
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

but when try to execute the same code at line (Object obj = ctx.lookup("/Hello") in IBM jre I am facing following Exception

Exception is

Exception in thread "P=169394 =0:CT" java.lang.NoClassDefFoundError: org.jboss.mx.util.Serialization
at javax.management.ObjectName.<clinit>(ObjectName.java:86)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:131)
at javax.management.remote.rmi.RMIConnectionImpl_Stub.class$(RMIConnectionImpl_Stub.java:6)
at javax.management.remote.rmi.RMIConnectionImpl_Stub.<clinit>(RMIConnectionImpl_Stub.java:41)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:131)
at javax.management.remote.rmi.RMIConnector.<clinit>(RMIConnector.java:2006)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:150)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:945)
at java.lang.reflect.Field.getFieldAccessor(Field.java:926)
at java.lang.reflect.Field.get(Field.java:385)
at com.ibm.CORBA.iiop.UtilDelegateImpl$2.run(UtilDelegateImpl.java:178)
at java.security.AccessController.doPrivileged(AccessController.java:192)
at com.ibm.CORBA.iiop.UtilDelegateImpl.<clinit>(UtilDelegateImpl.java:170)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:144)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1263)
at javax.rmi.CORBA.Util.createDelegateIfSpecified(Util.java:359)
at javax.rmi.CORBA.Util.<clinit>(Util.java:70)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at com.ibm.rmi.corba.PluginRegistry.instantiatePlugins(PluginRegistry.java:116)
at com.ibm.rmi.corba.ORB.instantiatePlugins(ORB.java:1386)
at com.ibm.rmi.corba.ORB.orbParameters(ORB.java:1298)
at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1206)
at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1662)
at org.omg.CORBA.ORB.init(ORB.java:364)
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)
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(InitialContext.java:363)
at TestHello.main(TestHello.java:26)


can any one tell me or give me a source for standalone java client which is working.
 
Consider Paul's rocket mass heater.
 
subject: Standalone java client to lookup ejb in websphere