Today I was battling an issue for some of my colleagues. They were getting this exception from JBoss while starting :
java.net.BindException: Cannot assign requested address: 8443 at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:500)
in the JBoss console.
Then making a Google search for above error and we read a bit of forums that was mentioning the error. Which talked about problems due to incorrect hostname or IP address. The problem was this machine was earlier in DMZ and was brought out. The IP address was changed. So we tried started looking for old IP which was set. We had to make changes in 2 files.
- /etc/hosts
- $JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml
In /etc/hosts changed
192.200.2.21 mymachine
to
10.0.2.222 mymachine
In $JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml changed
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" strategy="ms" address="192.200.2.21" keystoreFile="/path/to/jboss/server/default/conf/GB_Secure.bin" keystorePass="mykey" truststoreFile="/path/to/jboss/server/default/conf/GB_Secure.bin" truststorePass="mykey" sslProtocol="TLS"/>
to
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" strategy="ms" address="10.0.2.222" keystoreFile="/path/to/jboss/server/default/conf/GB_Secure.bin" keystorePass="mykey" truststoreFile="/path/to/jboss/server/default/conf/GB_Secure.bin" truststorePass="mykey" sslProtocol="TLS"/>
Result: The server started without any bind exceptions.
