我正在使用命令 mvn tomee:run 部署 archetype tomee-cf,我得到地址已经在使用中的问题。我检查了是否有东西在端口 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$1] (value [com.netflix.hystrix.Hystrix$1@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 .

您还可以在资源监视器的帮助下检查哪个进程正在使用该端口。


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!