Issue
Deploying on Apache Tomcat or TomEE
profile mode: false
debug mode: false
force redeploy: true
Starting of Tomcat failed, the server port 8080 is already in use.
Hi I have a spring-framework based MVC project and I'm trying to build as simple CMS website.
I was working on it yesterday even though I have problems with actually running it because of my lack of understanding of the whole framework.
But today I'm getting the same message again and again even after trying solutions that fellow developers are suggesting like killing the process that's using that port via command prompt or simply changing the port number of server.xml file and even restarting my laptop which obviously didn't work.
I'm aware that I might get some hidden exception messages in apache tomcat log files but I'm not sure where to look?
Any help is highly appreciated since I'm stuck with the same message and tons of posts that suggest the same thing with different variations nothing worked so far.
EDIT:
Here is the full Apache Tomcat or TomEE message:
Using CATALINA_BASE: "C:\Program Files\Apache Software Foundation\Tomcat 9.0" Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Tomcat 9.0" Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp" Using JRE_HOME:
"C:\Program Files\Java\jdk1.8.0_162" Using CLASSPATH:
"C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\tomcat-juli.jar" 31-Jul-2018 11:33:23.620 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.8 31-Jul-2018 11:33:23.622 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Apr 27 2018 19:32:00 UTC 31-Jul-2018 11:33:23.622 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:
9.0.8.0 31-Jul-2018 11:33:23.622 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:
Windows 10 31-Jul-2018 11:33:23.622 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:
10.0 31-Jul-2018 11:33:23.622 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:
amd64 31-Jul-2018 11:33:23.623 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:
C:\Program Files\Java\jdk1.8.0_162\jre 31-Jul-2018 11:33:23.623 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_162-b12 31-Jul-2018 11:33:23.623 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
Oracle Corporation 31-Jul-2018 11:33:23.624 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:
C:\Program Files\Apache Software Foundation\Tomcat 9.0 31-Jul-2018 11:33:23.624 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:
C:\Program Files\Apache Software Foundation\Tomcat 9.0 31-Jul-2018 11:33:23.624 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\logging.properties 31-Jul-2018 11:33:23.624 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 31-Jul-2018 11:33:23.624 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.nonProxyHosts=localhost|127.0.0.1|LAPTOP-R1QUMCBE 31-Jul-2018 11:33:23.624 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 31-Jul-2018 11:33:23.625 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 31-Jul-2018 11:33:23.625 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 31-Jul-2018 11:33:23.625 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 9.0 31-Jul-2018 11:33:23.625 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0 31-Jul-2018 11:33:23.625 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp 31-Jul-2018 11:33:23.625 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3]. 31-Jul-2018 11:33:23.625 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 31-Jul-2018 11:33:23.625 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 31-Jul-2018 11:33:24.339 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2m 2 Nov 2017] 31-Jul-2018 11:33:24.470 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"] 31-Jul-2018 11:33:24.634 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 31-Jul-2018 11:33:24.642 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"] 31-Jul-2018 11:33:24.643 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[AJP/1.3-8009]] org.apache.catalina.LifecycleException: Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:935) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:530) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:852) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.startup.Catalina.load(Catalina.java:633) at org.apache.catalina.startup.Catalina.load(Catalina.java:656) 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.load(Bootstrap.java:306) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491) Caused by: java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:227) at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:202) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1043) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:540) at org.apache.catalina.connector.Connector.initInternal(Connector.java:932) ... 13 more31-Jul-2018 11:33:24.644 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1365 ms 31-Jul-2018 11:33:24.668 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 31-Jul-2018 11:33:24.669 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.8 31-Jul-2018 11:33:24.678 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Catalina\localhost\cms.xml] 31-Jul-2018 11:33:24.699 WARNING [main] org.apache.catalina.startup.HostConfig.deployDescriptor The path attribute with value [/cms] in deployment descriptor [C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Catalina\localhost\cms.xml] has been ignored 31-Jul-2018 11:33:26.752 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 31-Jul-2018 11:33:28.344 INFO [main] org.hibernate.jpa.internal.util.LogHelper.logPersistenceUnitInformation HHH000204: Processing PersistenceUnitInfo [ name: cms ...] 31-Jul-2018 11:33:28.522 INFO [main] org.hibernate.Version.logVersion HHH000412: Hibernate Core {5.2.9.Final} 31-Jul-2018 11:33:28.525 INFO [main] org.hibernate.cfg.Environment. HHH000206: hibernate.properties not found 31-Jul-2018 11:33:28.606 INFO [main] org.hibernate.annotations.common.reflection.java.JavaReflectionManager. HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 31-Jul-2018 11:33:28.850 INFO [main] org.hibernate.dialect.Dialect. HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 31-Jul-2018 11:33:30.808 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file 31-Jul-2018 11:33:30.810 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/cms] startup failed due to previous errors 31-Jul-2018 11:33:30.823 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [cms] registered the JDBC driver [org.h2.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 31-Jul-2018 11:33:30.829 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Catalina\localhost\cms.xml] has finished in [6,151] ms 31-Jul-2018 11:33:30.832 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 31-Jul-2018 11:33:30.842 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 6197 ms
I see this:
Caused by: java.net.BindException: Address already in use: bind
OK, I get it but I tried killed the processes that use it still nothing, I'm going to try with TCPView
EDIT: This was when I was trying to use NetBeans, once I started using STS I don't have any problems with tomcat.
Solution
Try listing all the apps and their ports, and check for the one using 8080 and try to kill it or you can directly kill whatever app is using that port
The 2nd option is to change the port of your tomcat server with any available port
I hope this may solve your problem
Answered By - Noblesse
Answer Checked By - Terry (JavaFixing Volunteer)