Tomcat Cannot assign requested address: JVM_Bind

Today I started getting this weird looking exception while launching tomcat.

SEVERE: StandardServer.await: create[localhost:8005]: Cannot assign requested address: JVM_Bind
        at Method)
        at org.apache.catalina.core.StandardServer.await(
        at org.apache.catalina.startup.Catalina.await(
        at org.apache.catalina.startup.Catalina.start(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.catalina.startup.Bootstrap.start(
        at org.apache.catalina.startup.Bootstrap.main(

I googled around and most answers were pointing towards Port is already being used, which definitely wasn’t the issue in my case, anyways after spending few hours I figured out my main issue was that my IPV4 address changed. Although I never updated my server.xml to change localhost to any specific IP address but yet I started getting this error.

The actual cause of this issue was my host file present at WINDOWS_INSTALLTION/windows/System32/drivers/etc, where in which my old IP address was mapped against localhost like below: localhost
192.168.XXX.XX localhost

This second line was the main culprit, there are two ways of solving this:

  1. Remove 192.168.XXX.XX localhost line completely from host file
  2. Replace old IP with new IP in your host file i.e instead of 192.168.XXX.XX localhost change it to 192.168.XXX.YY localhost

Hope this helps!

There are 22 comments

  1. Mohd Rashid

    Really very nice.. it helps me a lot. i was stuck and try to close the services and ports so many times.. but it was Host.. πŸ˜‰

  2. Leo Bi

    Thanks a lot! I had tried so many approaches, and finally this article helped me out! It is because my workstation IP had been changed recently but I didn’t realize it. Orz

  3. Harinath

    yup, I changed my hosts file when I was in different network. now I started getting this error since. updated hosts file to look normal. then it started working fine.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s