I am trying to connect to JBoss from a client but
I get the exception below.
I used the correct server address in jndi.properties
java.naming.provider.url=xxx.xxx.xxx.xxx:1099
What is wrong? Why 127.0.0.1 instead of xxx.xxx.xxx.xxx?
Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
at java.net.Socket.(Socket.java:273)
at java.net.Socket.(Socket.java:100)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:120)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:365)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
There is something wrong with your ip configuration.
RMI thinks your server's ip address is 127.0.0.1
You can check this by adding the following parameter
to the java command in run.sh or run.bat
(on the SERVER side !)
-Djava.rmi.server.hostname
RMI will now use the server's hostname instead of
trying to determine the ip address.
If this fixes your problem, then check you ip configuration.
You might want to continue to use host names?
Regards,
Adrian