Eclipse tomcat error: Document base does not exist or is not a readable directory

后端 未结 20 3484
误落风尘
误落风尘 2020-12-04 10:44
13-dic-2011 17.00.36 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in producti         


        
相关标签:
20条回答
  • 2020-12-04 11:19

    Happened to me a couple of times.

    Windows > Show view > Servers>

    A List of servers will be displayed at bottom Right click on it and delete.

    Now while running your project, Manually re select the server from list of existing servers and run.

    0 讨论(0)
  • 2020-12-04 11:20

    I got this error a few times. I got it because my project wasn't building correctly after running the "mvn eclipse:eclipse" line. Make sure your project is being built correctly, then add and remove the project from the server.

    0 讨论(0)
  • 2020-12-04 11:22

    I had the same problem using Tomcat 7 & Eclipse Mars.
    I solved it as follows:

    • stop Tomcat
    • open server.xml

      Ctrl + Shift + R > type "server.xml" > Open

    • search for "<Context docBase"

      Ctrl + F > type "<Context" > Find

    • remove all <Context .../> tags from here:

      <?xml version="1.0" encoding="UTF-8"?>
      ...
      <Server port="8005" shutdown="SHUTDOWN">
          ...
          <Service name="Catalina">
              ...
              <Engine defaultHost="localhost" name="Catalina">
                  ...
                  <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
                      ...
                      <!-- Remove the following lines! -->
                      <Context docBase="App1" path="/App1" reloadable="true" source="org.eclipse.jst.j2ee.server:App1" />
                      <Context docBase="App2" path="/App2" reloadable="true" source="org.eclipse.jst.j2ee.server:App2" />
                  </Host>
              </Engine>
          </Service>
      </Server>
      
      • probably at the end of the last line that has to be removed is </Host> (don't remove </Host>!)
    • Go to Servers tab > right click on the project(s) > Remove > OK

    • Right click on the project > Run As > Run on Server > Finish

      Now it should work!
      If you check the server.xml file, you'll see that a new correct "<Context ... />" line was generated.

    0 讨论(0)
  • 2020-12-04 11:24

    I got this problem when I imported a project and run it with Tomcat. I fixed it when I opened .project file and added some code:

    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
    
    0 讨论(0)
  • 2020-12-04 11:25

    Go to Tomcat Manager Select web app -> undeploy it

    0 讨论(0)
  • 2020-12-04 11:26

    The easiest solution (and what worked for me) was to delete my tomcat server from the "Servers" view in Eclipse, then create a new server and add all the appropriate modules to it.

    Sometimes tomcat gets confused and the easiest/least time consuming way to resolve things is to start over.

    0 讨论(0)
提交回复
热议问题