Cannot start a Tomcat v9.0 server in eclipse

假如想象 提交于 2021-02-11 15:40:29

问题


I have a problem starting my first Java Spring application, when simply trying to run my project, im given the following error:

Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version name:   Apache Tomcat/9.0.34
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Apr 3 2020 12:02:52 UTC
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 9.0.34.0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 7
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            6.1
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Program Files\Java\jre1.8.0_231
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_231-b11
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\Users\hds\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 9.0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\hds\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\hds\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 9.0\endorsed
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1250
Apr 19, 2020 9:41:31 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.7.0].
Apr 19, 2020 9:41:31 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Apr 19, 2020 9:41:31 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
Apr 19, 2020 9:41:31 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized [OpenSSL 1.1.1c  28 May 2019]
Apr 19, 2020 9:41:33 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Apr 19, 2020 9:41:33 PM org.apache.catalina.startup.Catalina load
INFO: Server initialization in [1,749] milliseconds
Apr 19, 2020 9:41:33 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Apr 19, 2020 9:41:33 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet engine: [Apache Tomcat/9.0.34]
Apr 19, 2020 9:41:34 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: 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.
Apr 19, 2020 9:41:35 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'dispatcher'
Apr 19, 2020 9:41:35 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: Initializing Servlet 'dispatcher'
Apr 19, 2020 9:41:37 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: Completed initialization in 2213 ms
Apr 19, 2020 9:41:37 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Apr 19, 2020 9:41:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in [4,096] milliseconds
Apr 19, 2020 9:41:37 PM org.apache.catalina.core.StandardServer await
SEVERE: Failed to create server shutdown socket on address [localhost] and port [8080] (base port [8080] and offset [0])
java.net.BindException: Address already in use: JVM_Bind
    at java.net.DualStackPlainSocketImpl.bind0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
    at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:584)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:721)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:667)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:343)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:474)

Apr 19, 2020 9:41:37 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-nio-8080"]
Apr 19, 2020 9:41:37 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service [Catalina]
Apr 19, 2020 9:41:37 PM org.apache.catalina.core.ApplicationContext log
INFO: Destroying Spring FrameworkServlet 'dispatcher'
Apr 19, 2020 9:41:37 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-nio-8080"]
Apr 19, 2020 9:41:37 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-nio-8080"]

I have no processes using port 8080 either 8090 (killed them in cmd) and the shutdown port in server.xml is defined as 8090, while startup is defined as 8080 so it all should work, but it seem not to somehow. Does anyone know a solution to this?

来源:https://stackoverflow.com/questions/61310709/cannot-start-a-tomcat-v9-0-server-in-eclipse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!