Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Datasource lookup on remote Websphere Application Server

 
Prabhakar Reddy Bokka
Ranch Hand
Posts: 197
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CarefullyChooseOneForum while posting. Moving to websphere forum.
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to ping the machine also.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic