[英]IllegalArgumentException: Document base \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps does not exist or is not a readable directory
When I try to run my project on my local Tomcat server, I get the error: 当我尝试在本地Tomcat服务器上运行项目时,出现错误消息:
Server Tomcat v7.0 Server at localhost failed to start.
I followed the advice in this Stackoverflow answer and deleted the folder tmp0
. 我遵循了这个Stackoverflow答案中的建议,并删除了文件夹
tmp0
。 but I still get the same error. 但我仍然遇到相同的错误。
I've copied the stack trace below. 我已经复制了下面的堆栈跟踪。
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Users\Imray\Projects\InstrurentalApp\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\instrurentalapp 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:5089)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
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)
Did you notice this line: 您是否注意到这一行:
java.lang.IllegalArgumentException: Document base C:\Users\Imray\Projects\
InstrurentalApp\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\
wtpwebapps\instrurentalapp does not exist or is not a readable directory
The message is clearly saying that either that directory does not exist, or that the Tomcat server does not have read access to it. 该消息清楚地表明该目录不存在,或者Tomcat服务器没有对该目录的读取权限。 And if you deleted it ... that might explain why it doesn't exist!
如果删除了它,这可能解释了为什么它不存在!
Actually, the pathname is very suspicious to me. 实际上,该路径名对我来说非常可疑。 It looks like a path to something in your development sandbox, and a deployed webapp (running in Tomcat) should not depend on such things.
它看起来像是您的开发沙箱中某条路径的路径,并且已部署的Web应用程序(在Tomcat中运行)不应依赖于此类东西。 (You shouldn't have that kind of stuff on your production server!) That may be the root cause of your problems;
(您的生产服务器上不应该有这种东西!)这可能是问题的根本原因。 ie you have neglected to put your resources into your WAR file and update your configuration files accordingly.
也就是说,您忽略了将资源放入WAR文件并相应地更新配置文件。
Try these 3 methods 试试这三种方法
1) try deleting the .snap file found in 1)尝试删除在中找到的.snap文件
yourprojectworkspace.metadata.plugins\\org.eclipse.core.resources yourprojectworkspace.metadata.plugins \\ org.eclipse.core.resources
2) The most common hiccup is when another web server (or any process for that matter) has laid claim to port 8080. This is the default HTTP port that Tomcat attempts to bind to at startup. 2)最常见的故障是另一台Web服务器(或与此有关的任何进程)向端口8080声明所有权时。这是Tomcat在启动时尝试绑定到的默认HTTP端口。 To change this, open the file:
要更改此设置,请打开文件:
$CATALINA_HOME/conf/server.xml
and search for '8080'. 并搜索“ 8080”。 Change it to a port that isn't in use, and is greater than 1024, as ports less than or equal to 1024 require superuser access to bind under UNIX.
将其更改为未使用且大于1024的端口,因为小于或等于1024的端口需要超级用户访问权才能在UNIX下绑定。 (Example 8181)
(示例8181)
Restart Tomcat and you're in business. 重新启动Tomcat,您就可以开展业务。 Be sure that you replace the "8080" in the URL you're using to access Tomcat.
确保在用于访问Tomcat的URL中替换“ 8080”。 For example, if you change the port to 8181, you would request the URL http://localhost:8181/ in your browser.
例如,如果将端口更改为8181,则将在浏览器中请求URL http:// localhost:8181 / 。
3) Open the bin folder which contains the shutdown.bat file residing inside the tomcat directory. 3)打开bin文件夹,其中包含位于tomcat目录中的shutdown.bat文件。 Run it, that should solve the port problem.
运行它,应该可以解决端口问题。
Just Change the port no, So you can solve this problem.. 只需更改端口号,即可解决此问题。
Take different port for 1. Tomcat Admin port: 8079 2. Http Port : 99 3. Ajp port : 8078 为1. Tomcat管理端口使用不同的端口:8079 2. Http端口:99 3. Ajp端口:8078
Check your web.xml file 检查您的web.xml文件
and make correction in url-pattern and servlet-class or any syntax error, and run project. 并更正url-pattern和servlet-class或任何语法错误,然后运行项目。
Hope it will work. 希望它能工作。 :D
:d
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.