It's strange. In our development environment, if JBOSS isn't running and we
attempt to run a client, we get the following exception as soon as we try and
Context.lookup(String name) where we are looking up a JMS connection factory:
javax.naming.CommunicationException: Could not obtain connection to any of these urls:
localhost:1099 and discovery failed with error: javax.naming.CommunicationException:
Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
[Root exception is javax.naming.CommunicationException: Failed to connect to server
localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to
connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection
refused: connect]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at test.SimpleJNDIClient.main(SimpleJNDIClient.java:26)
Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099
[Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server
localhost:1099 [Root exception is java.net.ConnectException: Connection refused:
connect]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
... 4 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server
localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
... 5 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:464)
at java.net.Socket.connect(Socket.java:414)
at java.net.Socket.(Socket.java:310)
at java.net.Socket.(Socket.java:212)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
... 5 more
However, when we run the same code in our client's environment, even though JBOSS
isn't running it seems to call some ha code that attempts to do the lookup anyway and
fails. The exception, with the exact same code, is now:
javax.naming.NameNotFoundException: ConnectionFactory
at org.jboss.ha.jndi.TreeHead.lookup(TreeHead.java:223)
at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:134)
at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.ha.framework.server.HARMIServerImpl.invoke(HARMIServerImpl.java:194)
at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.ha.framework.server.HARMIServerImpl_Stub.invoke(Unknown Source)
at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:153)
at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:238)
at $Proxy0.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at test.SimpleJNDIClient.main(SimpleJNDIClient.java:26)
We are very mystefied at what the difference might be? Can someone please illuminate us as
to what might be going on?
Thanks!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065112#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...