Tomcat 部署后页面未找到错误
Tomcat Page not found error after deployment
在 Tomcat 服务器中部署代码后,我收到在浏览器中查看的所有页面的“未找到”错误消息。
例如:- 未找到 /BOOKS/web/Index.html.
我在 web 文件夹下有 Index.html 文件。它是一个 Spring-MVC 框架应用程序。
这是错误日志的详细信息。
错误日志
INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
org.apache.catalina.core.StandardEngine.startInternal Starting Serviet Engine: Apache Tomcat/8.5.45
INFO [localhost startStop-1] org.apache.jasper.servlet.TldScanner.scanlars 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web
application archive [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/BOOKS]
WARNING [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used
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[/BOOKS]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig-java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.Java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1149)
at java.util.concurrent.ThreadPoolExecutor$worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Illega1StateException: Unable to complete the scan for annotations for web application [/BOOKS]
due to a WhosebugError, Possible root causes include a too low setting for -Xss and Illegal cyclic Inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1OutputStream->org.bouncycastle.asn1.DEROutputStream->org.bouncycastle.asn1.ASN1OutputStream)
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2116)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2054)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.Java:1923)
at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1230)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.Java:1134)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.Lifecyclebase.fireLifecyclefvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5063)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/BOOKS] java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/BOOKS]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:747)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
at org.apache.catalina.startup.HostConfig$Deploywar.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/BOOKS] has finished in [9,774] ms
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/examples]
INFO [localhost-startStop-1] 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/examples] has finished in [1,357] ms
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/docs]
INFO [localhost-startStop-1] 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/docs] has finished in [1,166] ms
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/manager]
INFO [localhost-startStop-1] 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/manager] has finished in [827] ms
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/host-manager]
INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScannerscanJars 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory
[/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/host-manager] has finished in [843] ms
INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8880"]
INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009"]
INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 17571 ms
请帮忙。
您的依赖项中必须有两个版本的 bcprov-*
:
- 一个旧版本(最高版本 1.46),其中
ASN1OutputStream
扩展了 DEROutputStream
,
- 最近的一个(从版本 1.47 开始),其中的层次结构是颠倒的:
DEROutputStream
extends ASN1OutputStream
.
在您的 Maven 依赖项中查找名称以 bcprov-
开头的多个依赖项,并检查您的应用程序的 WEB-INF/lib
文件夹中是否没有其他版本或 Tomcat' s common 类加载器($CATALINA_BASE
和 $CATALINA_HOME
的 lib
文件夹)。
编辑: 对于 Bouncy Castle(以及许多长期存在的库),多个 Maven 工件(分为两组:bouncycastle
和org.bouncycastle
) 使用几乎相同的代码:bcprov-jdk14
、bcprov-jdk15on
、bcprov-jdk15to18
等。参见 示例。
在 Tomcat 服务器中部署代码后,我收到在浏览器中查看的所有页面的“未找到”错误消息。
例如:- 未找到 /BOOKS/web/Index.html.
我在 web 文件夹下有 Index.html 文件。它是一个 Spring-MVC 框架应用程序。
这是错误日志的详细信息。
错误日志
INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
org.apache.catalina.core.StandardEngine.startInternal Starting Serviet Engine: Apache Tomcat/8.5.45
INFO [localhost startStop-1] org.apache.jasper.servlet.TldScanner.scanlars 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web
application archive [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/BOOKS]
WARNING [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used
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[/BOOKS]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig-java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.Java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1149)
at java.util.concurrent.ThreadPoolExecutor$worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Illega1StateException: Unable to complete the scan for annotations for web application [/BOOKS]
due to a WhosebugError, Possible root causes include a too low setting for -Xss and Illegal cyclic Inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1OutputStream->org.bouncycastle.asn1.DEROutputStream->org.bouncycastle.asn1.ASN1OutputStream)
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2116)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2054)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.Java:1923)
at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1230)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.Java:1134)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.Lifecyclebase.fireLifecyclefvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5063)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/BOOKS] java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/BOOKS]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:747)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
at org.apache.catalina.startup.HostConfig$Deploywar.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/BOOKS] has finished in [9,774] ms
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/examples]
INFO [localhost-startStop-1] 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/examples] has finished in [1,357] ms
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/docs]
INFO [localhost-startStop-1] 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/docs] has finished in [1,166] ms
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/manager]
INFO [localhost-startStop-1] 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/manager] has finished in [827] ms
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/host-manager]
INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScannerscanJars 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.
INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory
[/apps/opt/tomcat/apache-tomcat-8.5.45/webapps/host-manager] has finished in [843] ms
INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8880"]
INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009"]
INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 17571 ms
请帮忙。
您的依赖项中必须有两个版本的 bcprov-*
:
- 一个旧版本(最高版本 1.46),其中
ASN1OutputStream
扩展了DEROutputStream
, - 最近的一个(从版本 1.47 开始),其中的层次结构是颠倒的:
DEROutputStream
extendsASN1OutputStream
.
在您的 Maven 依赖项中查找名称以 bcprov-
开头的多个依赖项,并检查您的应用程序的 WEB-INF/lib
文件夹中是否没有其他版本或 Tomcat' s common 类加载器($CATALINA_BASE
和 $CATALINA_HOME
的 lib
文件夹)。
编辑: 对于 Bouncy Castle(以及许多长期存在的库),多个 Maven 工件(分为两组:bouncycastle
和org.bouncycastle
) 使用几乎相同的代码:bcprov-jdk14
、bcprov-jdk15on
、bcprov-jdk15to18
等。参见