java.lang.IllegalArgumentException和org.apache.catalina.LifecycleException

问题:java

No.1: java.lang.IllegalArgumentException: Document base C:\Users\hanrong\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Struts2_test1 does not exist or is not a readable directory
web

严重: Exception starting Context with name [/Struts2_test1]
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Struts2_test1]]apache

No.2: java.lang.IllegalArgumentException: Document base C:\Users\hanrong\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Struts2_test2 does not exist or is not a readable directory
服务器

严重: Exception starting Context with name [/Struts2_test2]
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Struts2_test2]]app

问题缘由:eclipse

在学习使用 Eclipse 开发 Java Web 应用程序时,经常会拷贝旧项目而后改个名字做为新的项目。这样直接运行新的项目则会发生以上的错误。由于旧项目和新项目的 Context root 是同样的,当它们同时被 Tomcat 服务器加载时,因为两个项目处于同一个虚拟主机(Host)当中,就会发生冲突了。webapp

解决方法:学习

修改其中一个项目工程的 Context root(以下图所示)。spa

QQ截图20150314171545

相关文章
相关标签/搜索