[jboss-user] [JNDI/Naming/Network] - jndi connecting problem

SunSpider do-not-reply at jboss.com
Sat Feb 16 08:27:32 EST 2008


I bind jboss to one network interface with ./run.sh -b x.x.x.x command.
When run on the local machine, client using jndi connects correctly to the configured address, and finishes successfully. but on remote machine, exception is thrown. more over, if the code is wrapped inside servlet, though jndi context is correct, the code always connect to localhost.
first one of the following stack trace is shown on remote machine, the second one is inside container.

//========================
{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.provider.url=192.168.1.101, java.naming.factory.url.pkgs=org.jnp.interfaces:org.jboss.naming}
javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.1.101 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 192.168.1.101:1099 [Root exception is java.lang.ClassNotFoundException: org.jnp.server.NamingServer_Stub]]
	at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1601)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:636)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
	at javax.naming.InitialContext.lookup(Unknown Source)
	at sunspider.jaxws20.tutorial.service.impl.eventing.AnnoucementEntity.(AnnoucementEntity.java:52)
	at sunspider.jaxws20.tutorial.service.impl.eventing.AnnoucementEntity.main(AnnoucementEntity.java:121)
Caused by: javax.naming.CommunicationException: Failed to connect to server 192.168.1.101:1099 [Root exception is java.lang.ClassNotFoundException: org.jnp.server.NamingServer_Stub]
	at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:276)
	at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1572)
	... 5 more
Caused by: java.lang.ClassNotFoundException: org.jnp.server.NamingServer_Stub
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
	at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
	at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
	at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
	at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
	at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	at java.rmi.MarshalledObject.get(Unknown Source)
	at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:259)
	... 6 more

//===========================
2008-02-16 19:45:09,834 INFO  [STDOUT] thread start
2008-02-16 19:45:09,850 INFO  [STDOUT] {java.naming.provider.url=192.168.1.101, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces:org.jboss.naming}
2008-02-16 19:45:15,020 DEBUG [org.jnp.interfaces.NamingContext] Failed to connect to localhost:1099
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]]
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:272)
        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1423)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:597)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:590)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at org.jboss.ws.extensions.eventing.mgmt.DispatcherDelegate.getServer(DispatcherDelegate.java:84)
        at org.jboss.ws.extensions.eventing.mgmt.DispatcherDelegate.getSubscriptionManager(DispatcherDelegate.java:65)
        at org.jboss.ws.extensions.eventing.mgmt.DispatcherDelegate.dispatch(DispatcherDelegate.java:44)
        at sunspider.jaxws20.tutorial.service.impl.eventing.AnnoucementEntity.run(AnnoucementEntity.java:132)
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:246)
        ... 8 more
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:516)
        at java.net.Socket.connect(Socket.java:466)
        at java.net.Socket.(Socket.java:366)
        at java.net.Socket.(Socket.java:266)
        at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
        at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:242)
        ... 8 more


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129819#4129819

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129819



More information about the jboss-user mailing list