tags:

views:

27

answers:

1
+1  Q: 

eclipse and tomcat

Hi!

I am trying to integrate eclipse with tomcat. My system is Debian Lenny and I have installed tomcat from http://tomcat.apache.org/. My problem is that when launching Tomcat from within eclipse I get the following error:

SEVERE: StandardServer.await: create[8005]: 
java.net.SocketException: Invalid argument
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
    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:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Jun 16, 2010 9:54:34 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jun 16, 2010 9:54:34 PM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.SocketException: Network is unreachable
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:218)
    at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:487)
    at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:284)
    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)

I suspect this is related to the java option java.net.preferIPv4Stack.

Thanks in advance!

+1  A: 

I was able to solve this by adding -Djava.net.preferIPv4Stack=true under Run Configurations -> Tomcat 6.0 Server at localhost.

Panayiotis Karabassis