gpt4 book ai didi

java - Apache Tomcat 8 仅在浏览器中呈现空白

转载 作者:行者123 更新时间:2023-11-28 22:07:31 24 4
gpt4 key购买 nike

我打开了一个 Tomcat 服务器并尝试在浏览器中访问 localhost:8080 但我看到的是空白。当我尝试访问不存在的 localhost:8080/missing 之类的内容时也会发生这种情况,因此我会看到 404。另一件事是,虽然 Mozilla 只是显示空白,但 Chrome 会给出此消息:“此本地主机页面不能成立”。我现在知道它是否相关,但是当我打开服务器时,我得到以下堆栈跟踪:

10-Jul-2017 11:45:06.353 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1129)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1871)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name UploaderForm
at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3191)
at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3182)
at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1385)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1198)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:783)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:307)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 10 more

10-Jul-2017 11:45:06.354 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory G:\Tomcat\apache-tomcat-8.0.45\webapps\ROOT
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:757)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1129)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1871)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

我提到我在 Windows 10 上使用 Java 8 和 Tomcat 8.0.45。

最佳答案

感谢Luciano ,我设法解决了它,所以问题是我的 web.xml 中的这个条目:

<servlet-mapping>
<servlet-name>UploaderForm</servlet-name>
<url-pattern>/UploaderForm</url-pattern>
</servlet-mapping>

它不应该在那里,因为 UploaderForm 不是一个 servlet,只是 ROOT 目录中的一个 html 表单。这也在堆栈跟踪的第 14 行中指定:

Caused by: java.lang.IllegalArgumentException: Servlet 映射指定了一个未知的 servlet 名称 UploaderForm

关于java - Apache Tomcat 8 仅在浏览器中呈现空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45007973/

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