tomcat启动报错:LifecycleException: 无法启动组件[org.apache.catalina.webresources.StandardRoot@22807d9a]

一、场景

启动tomcat失败,并且catalina.out出现异常信息

二、报错信息

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 无法启动组件[org.apache.catalina.webresources.StandardRoot@22807d9a]
		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:891)
		at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:793)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1360)
		at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1350)
		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: org.apache.catalina.LifecycleException: 无法启动组件[org.apache.catalina.webresources.StandardRoot@22807d9a]
		at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
		at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4590)
		at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4728)
		... 7 more
	Caused by: java.lang.IllegalArgumentException: 指定的主资源集 [/home/xxx/upload] 无效
		at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:720)
		at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:678)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		... 9 more
01-Aug-2023 13:53:17.719 严重 [main] org.apache.catalina.core.ContainerBase.startInternal 子容器启动失败
	java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 子容器启动失败
		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:891)
		at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:248)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.core.StandardService.startInternal(StandardService.java:429)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:776)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.startup.Catalina.start(Catalina.java:695)
		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:347)
		at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
	Caused by: org.apache.catalina.LifecycleException: 子容器启动失败
		at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:903)
		at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:793)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1360)
		at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1350)
		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)

三、排查

从以下2处报错信息可以看出,启动失败和WEB资源有关

1、无法启动组件[org.apache.catalina.webresources.StandardRoot@22807d9a]

2、Caused by: java.lang.IllegalArgumentException: 指定的主资源集 [/home/xxx/upload] 无效

3、进入tomcat的conf目录,打开server.xml配置文件,查看tomcat配置的静态资源目录

tomcat启动报错:LifecycleException: 无法启动组件[org.apache.catalina.webresources.StandardRoot@22807d9a]_第1张图片
4、确认该目录是否存在

tomcat启动报错:LifecycleException: 无法启动组件[org.apache.catalina.webresources.StandardRoot@22807d9a]_第2张图片

四、原因

tomcat配置的静态资源目录不存在

五、解决

方式1、更改tomcat所配置的静态资源目录,重启tomcat

方式2、新建tomcat所配置的静态资源目录,重启tomcat

你可能感兴趣的:(tomcat,tomcat,apache)