Java IllegalArgumentException: Document base \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 不存在或不是可读目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25588969/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IllegalArgumentException: Document base \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps does not exist or is not a readable directory
提问by CodyBugstein
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 answerand deleted the folder tmp0
. but I still get the same error.
我遵循了这个 Stackoverflow 答案中的建议并删除了文件夹tmp0
。但我仍然遇到同样的错误。
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)
采纳答案by Stephen C
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. And if you deleted it ... that might explain why it doesn't exist!
该消息清楚地表明该目录不存在,或者 Tomcat 服务器没有读取权限。如果你删除了它......这可能解释了为什么它不存在!
Actually, the pathname is very suspicious to me. It lookslike a path to something in your development sandbox, and a deployed webapp (running in Tomcat) should not depend on such things. (You shouldn't have that kind of stuff on your production server!) That may be the root cause of your problems; i.e. you have neglected to put your resources into your WAR file and update your configuration files accordingly.
实际上,路径名对我来说非常可疑。它看起来像是开发沙箱中某些东西的路径,并且已部署的 web 应用程序(在 Tomcat 中运行)不应依赖于这些东西。(你的生产服务器上不应该有那种东西!)这可能是你问题的根本原因;也就是说,您忽略了将资源放入 WAR 文件并相应地更新配置文件。
回答by Mayuresh Deshmukh
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
回答by Mhk
Try these 3 methods
试试这3个方法
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. To change this, open the file:
2) 最常见的问题是当另一个 Web 服务器(或任何与此相关的进程)声称使用端口 8080 时。这是 Tomcat 在启动时尝试绑定到的默认 HTTP 端口。要更改此设置,请打开文件:
$CATALINA_HOME/conf/server.xml
and search for '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. (Example 8181)
并搜索“8080”。将其更改为未使用且大于 1024 的端口,因为小于或等于 1024 的端口需要超级用户访问权限才能在 UNIX 下进行绑定。(例 8181)
Restart Tomcat and you're in business. Be sure that you replace the "8080" in the URL you're using to access Tomcat. For example, if you change the port to 8181, you would request the URL http://localhost:8181/in your browser.
重新启动 Tomcat,您就可以开始工作了。确保替换用于访问 Tomcat 的 URL 中的“8080”。例如,如果您将端口更改为 8181,您将在浏览器中请求 URL http://localhost:8181/。
3) Open the bin folder which contains the shutdown.bat file residing inside the tomcat directory. Run it, that should solve the port problem.
3) 打开包含位于 tomcat 目录中的 shutdown.bat 文件的 bin 文件夹。运行它,应该可以解决端口问题。
回答by Vivek Hande
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 或任何语法错误中进行更正,并运行项目。
回答by Hemlata
- Go on the server link (which is synchronized with the servlets) shown into the server console.
- Expand the the link.
- unsynchronize the synchronized servlets.
- Right click on the server link.
- Click on publish.
- Then start the server again.
- 转到服务器控制台中显示的服务器链接(与 servlet 同步)。
- 展开链接。
- 取消同步同步的 servlet。
- 右键单击服务器链接。
- 点击发布。
- 然后再次启动服务器。
Hope it will work. :D
希望它会起作用。:D