gpt4 book ai didi

java - 在本地主机错误启动 tomcat v9.0 服务器

转载 作者:行者123 更新时间:2023-11-28 23:59:02 26 4
gpt4 key购买 nike

我试图在 Spring STS 上的本地主机上启动 tomcat v9.0 服务器,但它弹出以下错误。

"starting tomcat v9.0 server at localhost has encountered a problem"

没有任何进程使用 8080 端口。所以这不应该是 8080 端口正在使用另一个进程。也尝试过更改端口,但它一次又一次地给出相同的错误。谁能帮我解决这个错误。

控制台中显示以下错误。

Mar 26, 2017 7:30:02 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:FitnessTracker' did not find a matching property.
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.0.M18
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Mar 8 2017 15:20:57 UTC
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.0.0
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jdk1.8.0_121\jre
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_121-b13
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: D:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: D:\dev\tools\apache-tomcat-9.0.0.M18
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=D:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=D:\dev\tools\apache-tomcat-9.0.0.M18
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=D:\dev\tools\apache-tomcat-9.0.0.M18\endorsed
Mar 26, 2017 7:30:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Mar 26, 2017 7:30:02 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_121\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Android;C:\Windows\System32;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;C:\apache-maven-3.3.9\bin;C:\Program Files (x86)\Java\jdk1.7.0_25\bin;C:\Users\Sameera\AppData\Local\Microsoft\WindowsApps;.
Mar 26, 2017 7:30:02 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Mar 26, 2017 7:30:03 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Mar 26, 2017 7:30:03 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Mar 26, 2017 7:30:03 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Mar 26, 2017 7:30:03 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1587 ms
Mar 26, 2017 7:30:03 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 26, 2017 7:30:03 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.0.M18
Mar 26, 2017 7:30:05 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/FitnessTracker]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:959)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1439)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
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:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/FitnessTracker]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1439)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
... 21 more
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name fitTracketServlet
at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3153)
at org.apache.catalina.Context.addServletMappingDecoded(Context.java:879)
at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1378)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1190)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5104)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 27 more

Mar 26, 2017 7:30:05 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:959)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
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:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:968)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1439)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
... 13 more

Mar 26, 2017 7:30:05 PM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:968)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
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:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)

Mar 26, 2017 7:30:05 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-nio-8080"]
Mar 26, 2017 7:30:05 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-nio-8009"]
Mar 26, 2017 7:30:05 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Mar 26, 2017 7:30:05 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-nio-8080"]
Mar 26, 2017 7:30:05 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-nio-8009"]

最佳答案

在 eclipse 中启动 tomcat 服务器之前,您必须验证两件事。

  1. 端口可用性:
    如果您的 tomcat 服务器端口已被使用,请终止这些进程。
    windows: netstat -aon |find/i "listening"|find "port_num"
    taskkill/F/PID “这里是你从上一个命令得到的 PID”
    Linux: sudo netstat -plten |grep java
    kill -9 "这里是你从之前的命令得到的 PID"
    您可以在 conf 文件夹中的 server.xml 中找到 tomcat 服务器端口。

  2. Apache 通用日志记录库。
    大多数servlet 初学者都不知道添加Apache 公共(public)日志库。从这里下载 jar :
    https://commons.apache.org/proper/commons-logging/download_logging.cgi

在这些进程之后尝试启动 apache tomcat 服务器。希望对您有所帮助。

关于java - 在本地主机错误启动 tomcat v9.0 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43030102/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com