wood burning stoves*
The moose likes Distributed Java and the fly likes WAS application clients Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "WAS application clients" Watch "WAS application clients" New topic
Author

WAS application clients

Matt TC
Greenhorn

Joined: Aug 04, 2005
Posts: 5
Hi,
I have tried and tried to connect to an ejb component deployed on WAS 5.1 without success. After switching initial context factories and adding loads of jars to the class path, I still cannot grab a handle to an ejb.
I now realise that this might be impossible, which would explain the existence of WAS application clients software.

Can anyone confirm this thought? It seems so silly that I am forced to use IBM's client to connect to its app server..

TIA,
-matt
Lars Vonk
Ranch Hand

Joined: Aug 05, 2005
Posts: 30
Hi,

I don't think you are forced to use IBM's client, but you will need some j2ee/ejb jars to be able to lookup and use an EJB. Is there any specific Exception your getting in your attempt to retrieve the EJB?
Matt TC
Greenhorn

Joined: Aug 04, 2005
Posts: 5
I added all the jars I could until I got rid of ClassNotFoundException's.
Then I get stuck with this stack trace:


*****************************************************
javax.naming.NamingException: Failed to initialize the ORB [Root exception is org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No]
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:293)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:368)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:112)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:422)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:143)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at ConverterClient.process(ConverterClient.java:75)
at ConverterClient.main(ConverterClient.java:33)
Caused by: org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No
at org.omg.CORBA.ORB.create_impl(ORB.java:297)
at org.omg.CORBA.ORB.init(ORB.java:336)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:77)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:174)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:98)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:74)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:386)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:284)
... 7 more
Caused by: java.lang.UnsatisfiedLinkError: registerNatives
at com.ibm.jvm.ExtendedSystem.registerNatives(Native Method)
at com.ibm.jvm.ExtendedSystem.<clinit>(ExtendedSystem.java:181)
at com.ibm.rmi.util.JDKBridge.setCodebaseProperties(JDKBridge.java:227)
at com.ibm.rmi.util.JDKBridge.<clinit>(JDKBridge.java:206)
at com.ibm.rmi.util.RepositoryId.<clinit>(RepositoryId.java:126)
at com.ibm.rmi.iiop.CDROutputStream.<clinit>(CDROutputStream.java:1127)
at com.ibm.rmi.corba.ORB.<init>(ORB.java:258)
at com.ibm.rmi.iiop.ORB.<init>(ORB.java:181)
at com.ibm.CORBA.iiop.ORB.<init>(ORB.java:559)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.omg.CORBA.ORB.create_impl(ORB.java:295)
... 14 more
********************************************************


That's when I use IBM's cosNaming factory. When I use com.sun.jndi.cosnaming.CNCtxFactory, I get a ClassCastException in PortableRemoteObject.narrow().

The same setup (using CNCtxFactory) works fine with the same bean deployed on Sun ONE 7.

Any ideas?
-matt
Lars Vonk
Ranch Hand

Joined: Aug 05, 2005
Posts: 30
Maybe i was wrong and you do need IBM specific client to connect to the appserver of IBM. I found some interesting information which might lead you to a solution:

http://forum.java.sun.com/thread.jspa?threadID=546489&messageID=3606401

And from IBM self about different types of clients:

http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/welcclientmodules.html

Good luck
Matt TC
Greenhorn

Joined: Aug 04, 2005
Posts: 5
Thanks for your time Lars!

I'm now fiddling with IBM application client and have given hope on making it work with the standard JDK..
Matt TC
Greenhorn

Joined: Aug 04, 2005
Posts: 5
Ok. I made it work under Sun's JDK.

In order to make it work with SUN's JDK and CNCtxFactory, be sure to rmi compile (with flag -iiop) the home interfaces of the beans you want to access and put them in the client's classpath. That way, I avoided the ClassCastException.

In order to make it work with IBM's Wsn...InitialFactory, I needed IBM's JDK and a whole lot of jars in order to avoid NoClassDefFoundError and UnsatisfiedLinkError (registerNatives).

Somehow, stubs were never needed on Sun ONE 7.
peter singleton
Greenhorn

Joined: Aug 30, 2005
Posts: 1
So what were the jars that were needed?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WAS application clients