Connection refused to host: 127.0.0.1
March 20th, 2009
Applies to:
JBoss
Description:
Occurs when when accessing JBoss from a remote client. When attempting to use JMS or RMI remotely, you might run across an exception that looks like this:
javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1
Cause:
This is the result of a problem in the JBoss server side configuration. You’re successfully talking to the correct server, but it does not know its own hostname or IP address.
The “-b” option for run.bat/run.sh enables us to tell JBoss the host it is running on. That solves this problem.
Eg. run.bat -b 192.168.9.6 -Djboss.bind.address=0.0.0.0 (the 2nd parameter makes jboss server accessible from remote clients)