wood burning stoves 2.0*
The moose likes Websphere and the fly likes Datasource lookup on remote Websphere Application Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Datasource lookup on remote Websphere Application Server" Watch "Datasource lookup on remote Websphere Application Server" New topic
Author

Datasource lookup on remote Websphere Application Server

Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 189

Hi All,

I am trying to access the datasource from the Websphere running on remote machine. But facing the exception.



The same code works when i access the datasource from the Websphere running on my loacl machine.

Can any one suggest what could be the problem?

Exception is below.
28-Jul-2010 15:36:15 com.ibm.ws.naming.util.WsnInitCtxFactory
WARNING: jndiUnavailCommErr
javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "iiop://10.255.22.145:2809". Make sure that any bootstrap address information in the URL is correct and that the target name server is running. A bootstrap address with no port specification defaults to port 2809. Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. [Root exception is org.omg.CORBA.TRANSIENT: java.net.SocketException: Operation timed out: connect:could be due to invalid address:host=frcacd5k.server.rbsgrp.net,port=2809 vmcid: IBM minor code: E02 completed: No]
at com.ibm.ws.naming.util.WsnInitCtxFactory.mapInitialReferenceFailure(WsnInitCtxFactory.java:2224)
at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1384)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:922)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:846)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:531)
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 com.dev.WriteCLOBClient.main(WriteCLOBClient.java:33)
Caused by: org.omg.CORBA.TRANSIENT: java.net.SocketException: Operation timed out: connect:could be due to invalid address:host=frcacd5k.server.rbsgrp.net,port=2809vmcid: IBM minor code: E02 completed: No
at com.ibm.CORBA.transport.TransportConnectionBase.connect(TransportConnectionBase.java:425)
at com.ibm.rmi.transport.TCPTransport.getConnection(TCPTransport.java:151)
at com.ibm.rmi.iiop.TransportManager.get(TransportManager.java:88)
at com.ibm.rmi.iiop.GIOPImpl.getConnection(GIOPImpl.java:115)
at com.ibm.rmi.iiop.GIOPImpl.locate(GIOPImpl.java:189)
at com.ibm.rmi.corba.Corbaloc.locateUsingINS(Corbaloc.java:307)
at com.ibm.rmi.corba.Corbaloc.resolve(Corbaloc.java:378)
at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3680)
at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3238)
at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3578)
at com.ibm.ws.naming.util.WsnInitCtxFactory.stringToObject(WsnInitCtxFactory.java:1509)
at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1360)
... 8 more
Caused by: java.net.SocketException: Operation timed out: connect:could be due to invalid address
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:372)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:233)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:220)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:385)
at java.net.Socket.connect(Socket.java:541)
at com.ibm.rmi.transport.TCPTransportConnection.createSocket(TCPTransportConnection.java:155)
at com.ibm.rmi.transport.TCPTransportConnection.createSocket(TCPTransportConnection.java:167)
at com.ibm.CORBA.transport.TransportConnectionBase.connect(TransportConnectionBase.java:354)
... 19 more


SCJP 5, SCWCD 5
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

CarefullyChooseOneForum while posting. Moving to websphere forum.


apigee, a better way to API!
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
Check this post.
http://www.coderanch.com/t/499569/Websphere/JNDI-lookup-datasource-standalone-application#2252198

Change your URL and use the full JNDI to the datasource as it appears in WAS ISC console.
Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 189

thanks for the reply Deepak.

My standalone program works perfectly alright when websphere and the java class running on same machine.
I am using IP address and port number even it is same machine.

When i try to run the same java class from someother machine it doesn't work.
Websphere is running on first machine and i am using the same IP address and port number.

Any thoughts why its happening like that?? See the exception stack trace posted above.
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
Have you ensured that you can ping from one machine to the other machine? I cannot think of anything else unless there are firewall or anti-virus programs blocking these calls.
Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 189

I am able to ping the machine also.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Datasource lookup on remote Websphere Application Server
 
Similar Threads
What did I do wront? JMS communication exception
Access DataSource from stand alone Client
JNDI exception
initial context problem
javax.naming.NamingException while lookup for JNDI Name of EJB