Tomcat 7 on FreeBSD 8.2 is throwing the following error in catalina.log.

    SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Can't assign requested address
        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:422
)
        at org.apache.catalina.startup.Catalina.await(Catalina.java:709)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:654)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)

I've tried passing a flag of "-Djava.net.preferIPv4Stack=true" via rc.conf, just in case it's related to IPv6 support being compiled in (this is the only lead I've found in all my web searching so far). What else should I be checking?

link|improve this question

79% accept rate
feedback

1 Answer

up vote 0 down vote accepted

Adding:

tomcat7_java_opts="-Djava.net.preferIPv4Stack=true"

to the /etc/rc.conf file is working now. I must have typoed it the first time or something else random was wrong as it did not work before, but does now...

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.