简体   繁体   中英

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:

Server Tomcat v7.0 Server at localhost failed to start.

I followed the advice in this Stackoverflow answer and deleted the folder 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. 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. (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.

Try these 3 methods

1) try deleting the .snap file found in

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:

   $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)

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.

3) Open the bin folder which contains the shutdown.bat file residing inside the tomcat directory. 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

Check your web.xml file

and make correction in url-pattern and servlet-class or any syntax error, and run project.

  1. Go on the server link (which is synchronized with the servlets) shown into the server console.
  2. Expand the the link.
  3. unsynchronize the synchronized servlets.
  4. Right click on the server link.
  5. Click on publish.
  6. Then start the server again.

Hope it will work. :D

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM