Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat start failure probably due to Linux network setup: java.net.BindException: Cannot assign requested address [closed]

I can't start tomcat due to the pasted stack trace, and I don't believe the answer is in Java. I've tried changing ports and confirmed that another port (8005) also fails with the same error message. How do I verify that my linux network setup allows Java to use ports?

EDIT2: It appears this box has been the victim of an intrusion. I believe it makes sense to flag this post for moderator to close since a compromised box can't be expected to behave normally. Thank you everyone for your time and effort.

EDIT: there is a possibility that corruption of packages in /bin is responsible. I had to update the a few with up2date.

EXTRA INFO:

Re: similar questions, I've eliminated the JVM_BIND possibility by checking netstat.

ping localhost simply hangs:


$ ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
-- no responses ---
--- localhost ping statistics ---
9 packets transmitted, 0 received, 100% packet loss, time 8000ms

ping google works:


$ ping google.com
PING google.com (74.125.225.228) 56(84) bytes of data.
-- responses removed ---
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 1.389/1.417/1.443/0.048 ms, pipe 2

the exception:


    SEVERE: StandardServer.await: create[8036]:
java.net.BindException: Cannot assign requested address
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(Unknown Source)
        at java.net.ServerSocket.bind(Unknown Source)
        at java.net.ServerSocket.(Unknown Source)
        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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Jun 5, 2013 12:49:05 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8035
Jun 5, 2013 12:49:05 PM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.SocketException: Invalid argument or cannot assign requested address
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.(Unknown Source)
        at java.net.Socket.(Unknown Source)
        at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:492)
        at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:289)
        at org.apache.jk.server.JkMain.pause(JkMain.java:725)
        at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153)
        at org.apache.catalina.connector.Connector.pause(Connector.java:1029)
        at org.apache.catalina.core.StandardService.stop(StandardService.java:566)
        at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
        at org.apache.catalina.startup.Catalina.stop(Catalina.java:648)
        at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:692)
like image 414
Core Avatar asked Jun 05 '13 18:06

Core


2 Answers

Seems to me that your /etc/host configuration is not correct. Are you able to ping 127.0.0.1? Also make sure you have following line in your host file

/etc/host

127.0.0.1           localhost

.

Please check if your "The Loopback Interface" is setup correctly.

like image 97
Gladwin Burboz Avatar answered Sep 28 '22 03:09

Gladwin Burboz


"java.net.BindException: Cannot assign requested address" suggests another instance of Tomcat didn't shutdown properly and is still using the port you assigned to tomcat.

like image 21
jksloan Avatar answered Sep 28 '22 02:09

jksloan