Tomcat Cannot assign requested address: JVM_Bind

Posted on

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!

22 thoughts on “Tomcat Cannot assign requested address: JVM_Bind

    seenu said:
    December 26, 2012 at 1:22 PM

    very nice one its really helped me.

    thank you alot.. πŸ™‚

    Mohd Rashid said:
    January 16, 2013 at 9:34 PM

    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.. πŸ˜‰

      Prabhat Jha responded:
      January 18, 2013 at 11:03 PM

      Glad I was of some help happy coding πŸ™‚

    venkat said:
    February 13, 2013 at 4:07 PM

    Wow … you saved my day … really very helpful … Thanks a lot πŸ™‚

    anil said:
    April 1, 2013 at 11:10 PM

    thanks it realy helped me

    Abid said:
    May 2, 2013 at 2:55 PM

    thanks dude..

    asdf said:
    June 25, 2013 at 6:34 PM

    this worked for me! thanks!

    vidhyadharan D (@vidhya_java) said:
    July 9, 2013 at 9:43 PM

    Thanks a lot .. Valuable info

    DK said:
    July 16, 2013 at 2:55 PM

    Thanks alot…spent lot of time resolving this issue….finally found the solution πŸ™‚

    Michael said:
    July 26, 2013 at 5:05 AM

    I suggest you create a question in stackoverflow and link
    this blog entry as an answer.

    sunny said:
    October 23, 2013 at 11:50 PM

    Wonderful it fixed my issue…

    chandra said:
    November 4, 2013 at 2:51 AM

    Lots of thanks you dear

    Satheesh Kumar said:
    November 8, 2013 at 5:36 PM


    tets said:
    January 17, 2014 at 10:35 PM

    It did help Thanks

    Leo Bi said:
    February 26, 2014 at 1:32 PM

    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

    colboy said:
    March 3, 2014 at 7:30 PM

    HAH! why on earth did i miss that! thanks a lot!

    Harinath said:
    March 5, 2014 at 7:28 AM

    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.

    Kir said:
    March 19, 2014 at 4:20 AM

    Yes! it was really hepful!

    asraful said:
    May 14, 2014 at 2:17 PM

    man you saved my day , exact answer it is ,

    Justin said:
    July 27, 2014 at 9:35 PM

    Wow Great buddy..Really helpfull uffffffff πŸ™‚

    Rahh said:
    September 4, 2014 at 3:00 PM

    Thank you….it really helpedme

      Sasi said:
      October 11, 2017 at 3:11 PM

      Glad I visited this page. Thanks man!

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 )

Google+ photo

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

Twitter picture

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

Facebook photo

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


Connecting to %s