tomcat报错java.lang.IllegalArgumentException: Document base XXXXX does not exist or is not a readable directory

时间:2021-10-22 11:18:28

  启动tomcat的时候报如下错误:

    java.lang.IllegalArgumentException: Document base F:\java\tools\tomcat\me-webapps\drp1.1 does not exist or is not a readable directory
      at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
      at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4324)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4493)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

  大概情况是F:\java\tools\tomcat\me-webapps\drp1.1这个路径没有drp1.1但在tomcat的work\Catalina\localhost\下面一直生成drp1.1,后来在tomcat的conf\server.xml中发现一句配置:

tomcat报错java.lang.IllegalArgumentException: Document base XXXXX does not exist or is not a readable directory

  把<context>删掉即可.