本文主要是介绍java.net.BindException: Address already in use null:10983,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一个服务器上部署了多个tomcat,新增了一个tomcat8084,启动tomcat时,报如下的错误
java.net.BindException: Address already in use <null>:10983
详细的错误:
SEVERE: Failed to initialize connector [Connector[AJP/1.3-10983]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-10983]]at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)at org.apache.catalina.core.StandardService.initInternal(StandardService.java:560)at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:838)at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)at org.apache.catalina.startup.Catalina.load(Catalina.java:642)at org.apache.catalina.startup.Catalina.load(Catalina.java:667)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:253)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failedat 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.BindException: Address already in use <null>:10983at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:413)at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:650)at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:435)at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)... 13 more
Caused by: java.net.BindException: Address already in useat 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:400)... 16 more
server.xml中的全部配置如下:
<?xml version='1.0' encoding='utf-8'?><Server port="8984" shutdown="SHUTDOWN"><Listener className="org.apache.catalina.startup.VersionLoggerListener" /><Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /><Listener className="org.apache.catalina.core.JasperListener" /><Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /><Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /><Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /><GlobalNamingResources><Resource name="UserDatabase" auth="Container"type="org.apache.catalina.UserDatabase"description="User database that can be updated and saved"factory="org.apache.catalina.users.MemoryUserDatabaseFactory"pathname="conf/tomcat-users.xml" /></GlobalNamingResources><Service name="Catalina"><Connector port="8084" protocol="HTTP/1.1"connectionTimeout="100000"maxThreads="1000"minSpareThreads="25"maxSpareThreads="300"enableLookups="false"acceptCount="2000"maxPostSize="-1"compression="on"compressionMinSize="50"noCompressionUserAgents="gozilla, traviata"compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"redirectPort="8443" /><Connector port="10984" protocol="AJP/1.3" redirectPort="8443" /><Engine name="Catalina" defaultHost="localhost"><Realm className="org.apache.catalina.realm.LockOutRealm"><Realm className="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/></Realm><Host name="localhost" appBase="webapps"unpackWARs="true" autoDeploy="true"><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log." suffix=".txt"pattern="%h %l %u %t "%r" %s %b" /></Host></Engine></Service>
</Server>
问题修复,修改接口端口,让和其他tomcat的端口不冲突。
<Server port="8984" shutdown="SHUTDOWN"><Connector port="8084" protocol="HTTP/1.1"connectionTimeout="100000"maxThreads="1000"minSpareThreads="25"maxSpareThreads="300"enableLookups="false"acceptCount="2000"maxPostSize="-1"compression="on"compressionMinSize="50"noCompressionUserAgents="gozilla, traviata"compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"redirectPort="8443" /><Connector port="10984" protocol="AJP/1.3" redirectPort="8443" />
主要修改这三处。
这篇关于java.net.BindException: Address already in use null:10983的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!