地址已在使用中:JVM_Bind 部署到本地主机时
Address already in use : JVM_Bind when deploying to localhost
我正在使用命令 mvn tomee:run 部署 archetype tomee-cf,我正在获取已在使用的地址 issue.I 检查端口 8005,8009,8080 上是否有 运行和 8443,发现只有一个系统 IPv4 监听 8005
我希望应用程序 运行 在本地主机
> INFO: Deployment of web application archive C:\Users\e4560\Desktop\address-manager\application\target\apache-tomee\webapps\ROOT.war has finished in 12,030 ms
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2019 10:31:57 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 12240 ms
Jan 18, 2019 10:31:57 AM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
at java.net.ServerSocket.bind(ServerSocket.java:375)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:444)
at org.apache.catalina.startup.Catalina.await(Catalina.java:782)
at org.apache.catalina.startup.Catalina.start(Catalina.java:728)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2019 10:31:57 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jan 18, 2019 10:31:57 AM org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeploying app: C:\Users\e09340\Desktop\address-manager\application\target\apache-tomee\webapps\ROOT
Jan 18, 2019 10:31:57 AM org.apache.openejb.util.OptionsLog info
INFO: Using 'openjpa.Log=org.apache.openejb.openjpa.JULOpenJPALogFactory'
Jan 18, 2019 10:31:57 AM org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeployed app: C:\Users\epom\Desktop\address-manager\application\target\apache-tomee\webapps\ROOT
Jan 18, 2019 10:31:57 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
SEVERE: The web application [] created a ThreadLocal with key of type [com.netflix.hystrix.Hystrix] (value [com.netflix.hystrix.Hystrix@4eedec61]) and a value of type [com.netflix.hystrix.Hystrix.ConcurrentStack] (value [com.netflix.hystrix.Hystrix$ConcurrentStack@740a0cb2]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2019 10:31:57 AM org.apache.openejb.server.SimpleServiceManager stop
INFO: Stopping server services
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
运行 带有 -Dtomee-plugin.shutdown=8006
的 maven 命令,这应该可以解决您的问题。
背景
从您的日志来看,您似乎在 Windows 机器上。 Windows 10 有一个更新恶魔,它始终在端口 8005 上侦听。更多详细信息是 here。
您还可以借助资源监视器检查哪个进程正在使用该端口。
我正在使用命令 mvn tomee:run 部署 archetype tomee-cf,我正在获取已在使用的地址 issue.I 检查端口 8005,8009,8080 上是否有 运行和 8443,发现只有一个系统 IPv4 监听 8005
我希望应用程序 运行 在本地主机
> INFO: Deployment of web application archive C:\Users\e4560\Desktop\address-manager\application\target\apache-tomee\webapps\ROOT.war has finished in 12,030 ms
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2019 10:31:57 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 12240 ms
Jan 18, 2019 10:31:57 AM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
at java.net.ServerSocket.bind(ServerSocket.java:375)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:444)
at org.apache.catalina.startup.Catalina.await(Catalina.java:782)
at org.apache.catalina.startup.Catalina.start(Catalina.java:728)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2019 10:31:57 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jan 18, 2019 10:31:57 AM org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeploying app: C:\Users\e09340\Desktop\address-manager\application\target\apache-tomee\webapps\ROOT
Jan 18, 2019 10:31:57 AM org.apache.openejb.util.OptionsLog info
INFO: Using 'openjpa.Log=org.apache.openejb.openjpa.JULOpenJPALogFactory'
Jan 18, 2019 10:31:57 AM org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeployed app: C:\Users\epom\Desktop\address-manager\application\target\apache-tomee\webapps\ROOT
Jan 18, 2019 10:31:57 AM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
SEVERE: The web application [] created a ThreadLocal with key of type [com.netflix.hystrix.Hystrix] (value [com.netflix.hystrix.Hystrix@4eedec61]) and a value of type [com.netflix.hystrix.Hystrix.ConcurrentStack] (value [com.netflix.hystrix.Hystrix$ConcurrentStack@740a0cb2]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2019 10:31:57 AM org.apache.openejb.server.SimpleServiceManager stop
INFO: Stopping server services
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Jan 18, 2019 10:31:57 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
运行 带有 -Dtomee-plugin.shutdown=8006
的 maven 命令,这应该可以解决您的问题。
背景
从您的日志来看,您似乎在 Windows 机器上。 Windows 10 有一个更新恶魔,它始终在端口 8005 上侦听。更多详细信息是 here。
您还可以借助资源监视器检查哪个进程正在使用该端口。