I am deploying archetype tomee-cf using the command mvn tomee:run
and I am getting address already in use issue. I checked whether something is running on ports 8005, 8009, 8080 and 8443 and found only a system IPv4 listening to 8005.
I expect the application to run on localhost.
EDIT (from comments): the command netstat -o -n -a | findstr 0.0:8005
gives the output TCP 0.0.0.0:8005 0.0.0.0:0 LISTENING 4
.
Log:
> 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"]
Run the maven command with -Dtomee-plugin.shutdown=8006
, this should fix your problem.
Background
From your log, it appears that you are on a Windows machine. Windows 10 has an update demon which is always listening on the port 8005. More details are here .
You can also check which process is using the port with the help of the resource monitor.