title: JBoss server connection refused on localhost:1099
body: <p>I have an instance of JBoss 5.0.1 GA running on a remote server. The server attempts to start a batch service located on the same instance, but it reports connection refused. I found some webpage that said to add the localhost address to jndi.properties, but then the server fails to start altogether. The error code:</p>
  
  <pre>
  10:27:23,831 DEBUG [TimedSocketFactory] createSocket, hostAddr: localhost/127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 0
  10:27:23,831 DEBUG [NamingContext] Failed to connect to localhost:1099
  javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException:
  Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]]
  </pre>
  
  <p>I run the command <pre>netstat -anpt</pre> and the list contains the IP of this server and port 1099.</p>
  
  <p>I run <pre>telnet [IP of server] 8080</pre>and it connects successfully.</p>
  
  <p>I run <pre>telnet [IP of server] 1099</pre> and it returns connection refused and some weird characters.</p>
  
  <p>Any ideas on what to do about this? Thanks</p>