ポート8080をデフォルトのHTTPポート(80)に変更して、JerseyアプリケーションをHTTP-Restful APIとして使用します。そのため、ポートを8080から80(/etc/Tomcat7/server.xml
内)に置き換え、AUTHBIND(/etc/defaults/Tomcat7
)を使用するように構成しました。サービスを再起動した後、/var/log/Tomcat7/catalina.out
にこの奇妙なエラーが見つかりました。
誰かがこのエラーを翻訳できますか? Tomcatがソケットを作成できないのはなぜですか?
私はubuntu 14.04とTomcat7を使用しています。
INFO: Initializing ProtocolHandler ["http-bio-80"]
Jul 25, 2014 4:08:28 AM org.Apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-80"]
Java.net.SocketException: No such file or directory
at Java.net.PlainSocketImpl.socketBind(Native Method)
at Java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.Java:376)
at Java.net.ServerSocket.bind(ServerSocket.Java:376)
at Java.net.ServerSocket.<init>(ServerSocket.Java:237)
at Java.net.ServerSocket.<init>(ServerSocket.Java:181)
at org.Apache.Tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.Java:49)
at org.Apache.Tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.Java:397)
at org.Apache.Tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.Java:640)
at org.Apache.coyote.AbstractProtocol.init(AbstractProtocol.Java:434)
at org.Apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.Java:119)
at org.Apache.catalina.connector.Connector.initInternal(Connector.Java:978)
at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:102)
at org.Apache.catalina.core.StandardService.initInternal(StandardService.Java:559)
at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:102)
at org.Apache.catalina.core.StandardServer.initInternal(StandardServer.Java:813)
at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:102)
at org.Apache.catalina.startup.Catalina.load(Catalina.Java:638)
at org.Apache.catalina.startup.Catalina.load(Catalina.Java:663)
at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:57)
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
at Java.lang.reflect.Method.invoke(Method.Java:606)
at org.Apache.catalina.startup.Bootstrap.load(Bootstrap.Java:280)
at org.Apache.catalina.startup.Bootstrap.main(Bootstrap.Java:454)
Jul 25, 2014 4:08:28 AM org.Apache.catalina.core.StandardService initInternal
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-80]]
org.Apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-80]]
at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:106)
at org.Apache.catalina.core.StandardService.initInternal(StandardService.Java:559)
at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:102)
at org.Apache.catalina.core.StandardServer.initInternal(StandardServer.Java:813)
at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:102)
at org.Apache.catalina.startup.Catalina.load(Catalina.Java:638)
at org.Apache.catalina.startup.Catalina.load(Catalina.Java:663)
at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:57)
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
at Java.lang.reflect.Method.invoke(Method.Java:606)
at org.Apache.catalina.startup.Bootstrap.load(Bootstrap.Java:280)
at org.Apache.catalina.startup.Bootstrap.main(Bootstrap.Java:454)
Caused by: org.Apache.catalina.LifecycleException: Protocol handler initialization failed
at org.Apache.catalina.connector.Connector.initInternal(Connector.Java:980)
at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:102)
... 12 more
Caused by: Java.net.SocketException: No such file or directory
at Java.net.PlainSocketImpl.socketBind(Native Method)
at Java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.Java:376)
at Java.net.ServerSocket.bind(ServerSocket.Java:376)
at Java.net.ServerSocket.<init>(ServerSocket.Java:237)
at Java.net.ServerSocket.<init>(ServerSocket.Java:181)
at org.Apache.Tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.Java:49)
at org.Apache.Tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.Java:397)
at org.Apache.Tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.Java:640)
at org.Apache.coyote.AbstractProtocol.init(AbstractProtocol.Java:434)
at org.Apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.Java:119)
at org.Apache.catalina.connector.Connector.initInternal(Connector.Java:978)
... 13 more
私は実用的な解決策を見つけました:
Sudo touch /etc/authbind/byport/80
Sudo chmod 500 /etc/authbind/byport/80
Sudo chown Tomcat7 /etc/authbind/byport/80
https://stackoverflow.com/questions/23272666/Tomcat7-bind-to-port-80-fails-in-ubuntu-14-04lts