Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

问题描述:

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

    严重: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\Code\MyJavaCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newsInfoCrawler does not exist or is not a readable directory

 

 

解决办法:

需要执行下面操作:

  步骤一:首先,进入,你的工作区间目录下的.metadata\.plugins\org.eclipse.wst.server.core/下

比如,我的这里是

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

 

 

  步骤二:进入tmp0/conf/目录,删除无用的 tmp0\conf\server.xml 中的  <Context>  节点; 

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

<Context docBase="D:\Code\MyJavaCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ROOT" path="" reloadable="false"/>

<Context docBase="D:\Code\MyJavaCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newsInfoCrawler" path="/newsInfoCrawler" reloadable="true" source="org.eclipse.jst.jee.server:newsInfoCrawler"/></Host>

 

删除,留下,得到

<Context docBase="D:\Code\MyJavaCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ROOT" path="" reloadable="false"/></Host>

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

 

 

 

 

  步骤三:删除 tmp0\work\Catalina\localhost 下的所有文件夹;

我这里是,D:\Code\MyJavaCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost

 Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

 

 

 


  步骤四:删除tomcat

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

 

 

 

  步骤五:重新配置tomcat

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

Eclipse里Tomcat报错:Document base ……does not exist or is not a readable directory

  本人就是通过此种方式完成的,可以恢复!当初工具同时也报错:Server Tomcat v7.0 Server at localhost failed to start.因为控制台报错了,所以Tomcat肯定是运行不了的,也是这个方法解决的。希望对大家有所帮助!