Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat won't start: java.net.BindException: Cannot assign requested address

Tags:

tomcat

when I start my locale instance of Tomcat I get the following error:

    SEVERE: StandardServer.await: create[8005]: 
    java.net.BindException: Cannot assign requested address: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
    at java.net.ServerSocket.bind(ServerSocket.java:319)
    at java.net.ServerSocket.<init>(ServerSocket.java:185)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:373)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:662)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:614)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

I have seen on forums people had the same problem. Netstat doesn't show ports 8080, 8005 or 8009 in use. I tried to change port but I get the same error. I've also checked the hosts file in Windows\System32\drivers\etc and the line

127.0.0.1       localhost

is not commented. I didn't change anything in server.xml and since yesterday I can't get it to work. Any ideas?

EDIT:

<Server port="8005" shutdown="SHUTDOWN">

Connectors:
 <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000" 
               redirectPort="8443" />

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               />

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Thanks for you help

like image 739
gajo Avatar asked May 24 '12 08:05

gajo


People also ask

What does can't assign to requested address mean?

10.18 'Network error: Cannot assign requested address' This means that the operating system rejected the parameters of the network connection PuTTY tried to make, usually without actually trying to connect to anything, because they were simply invalid.

Can't assign requested address connect?

This error is not specifically for macOS, it tells you that the provided IP is not available for your network or it's already in use. You should provide an assigned IP from your networks, you could execute hostname -I (or equivalent) to check them.

Can't grab with bind Cannot assign requested address?

The message “Cannot assign requested address” suggests that the hostname/IP you are trying to bind does not resolve to a local network interface. A few things to check: Are the full hostnames (eg 01.mongodb.DOMAIN.nl ) resolvable on all of your replica set members?


3 Answers

I solved this by specifying

<Server address="0.0.0.0" port="8005" shutdown="SHUTDOWN">

at conf/server.xml.

like image 167
Eugene Gr. Philippov Avatar answered Oct 14 '22 08:10

Eugene Gr. Philippov


the IP of your server has been changed (even IP of other network cards that you don't use) and you have to edit.

C:\Windows\System32\drivers\etc\hosts
like image 8
mehdi Avatar answered Oct 14 '22 06:10

mehdi


most possible cause is : your IP address for localhost is not confgured correctly in the host file. Verify the host file : run : system32 : drivers : etc : host Open this host file in Notepad

Keep this localhost line as 1st line in the host file. Close everything. Delete the server from Eclipse and re-configure this. It should help.

like image 4
Saurabh M. Chande Avatar answered Oct 14 '22 06:10

Saurabh M. Chande