Error starting static Resources java.lang.IllegalArgumentExc

时间:2021-12-14 18:27:35

  今天,在eclipse上想整理下过去的项目,把之前没用的一些项目删了,把一些项目改了下名,结果再启动jsp页面的时候就出现了以下错误并提示Tomcat启动失败。

严重: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:eclipse.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappsA2019.09.00--xiao_xue_qi does not exist or is not a readable directory
    at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:136)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5247)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5436)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
    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)

十一月 24, 2019 9:30:26 上午 org.apache.catalina.core.ContainerBase startInternal
严重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/A2019.09.00--xiao_xue_qi]]
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1119)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
    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: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/A2019.09.00--xiao_xue_qi]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    ... 6 more
Caused by: org.apache.catalina.LifecycleException: Error in resourceStart()
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5437)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 6 more

十一月 24, 2019 9:30:26 上午 org.apache.catalina.core.StandardContext resourcesStart
...

  记得之前遇到过类似的问题,应该不是什么大问题,就没有尝试重装Tomcat之类的会浪费时间,我查看了Tomcat下的server.xml文件,在文件最下方看到以下代码:

<Context docBase="KCPingTai_" path="/KCPingTai_" reloadable="true" source="org.eclipse.jst.jee.server:KCPingTai_"/>
    <Context docBase="wjdc" path="/wjdc" reloadable="true" source="org.eclipse.jst.jee.server:wjdc"/>
    <Context docBase="A2019.09.00--xiao_xue_qi" path="/A2019.09.00--xiao_xue_qi" reloadable="true" source="org.eclipse.jst.jee.server:A2019.09.00--xiao_xue_qi"/>
    <Context docBase="Zu_Pu_Analysis" path="/Zu_Pu_Analysis" reloadable="true" source="org.eclipse.jst.jee.server:Zu_Pu_Analysis"/>

</Host>

  把所有四行代码删除:Tomcat启动正常但网页报404;

  只留下要启动项目的代码:项目完美运行;

  再把代码还原就会出现同样的error;

  原来问题出在这里,问题解决!