tomcat启动异常java.lang.IllegalArgumentException: Document base xxx does not exist or is not a readable

错误:java.lang.IllegalArgumentException: Document base D:/apache-tomcat-7.0.40/webapps/TestWeb does not exist or is not a readable directory

第一种情况:除了该tomcat服务器下的C:\apache-tomcat-7.0.42\webapps\TestWeb项目,而同时也把C:\apache-tomcat-7.0.42\work\Catalina\localhost\TestWeb项目删除掉了,

解决方法:

打开C:\apache-tomcat-7.0.42\conf\struts.xml里面,把该行注释

tomcat启动异常java.lang.IllegalArgumentException: Document base xxx does not exist or is not a readable

第二种情况:用eclipse部署在tomcat的wtpwebapps文件夹下,然后直接将该文件夹下的项目删除,启动出现异常

解决办法:

打开conf文件夹下的server.xml文件,在最后有关于该项目的配置,如图:

tomcat启动异常java.lang.IllegalArgumentException: Document base xxx does not exist or is not a readable

直接删除<context/>标签,

tomcat启动异常java.lang.IllegalArgumentException: Document base xxx does not exist or is not a readable

重新启动,异常消失