严重: Error starting static Resources java.lang.IllegalArgumentException 解决方法

配置完CATALINA_HOME和path之后,在开始——>运行输入“startup”

碰见下图错误:

严重: Error starting static Resources java.lang.IllegalArgumentException 解决方法_第1张图片

整理如下:

先启动startup.bat文件,找到对应的环境变量:

Using CATALINA_BASE:   "D:\Program Files (x86)\apache-tomcat-6.0.43"
Using CATALINA_HOME:   "D:\Program Files (x86)\apache-tomcat-6.0.43"
Using CATALINA_TMPDIR: "D:\Program Files (x86)\apache-tomcat-6.0.43\temp"
Using JRE_HOME:        "D:\Program Files (x86)\Java\jdk1.6.0_45"
Using CLASSPATH:       "D:\Program Files (x86)\apache-tomcat-6.0.43\bin\bootstrap.jar"
请按任意键继续. . .

然后开始启动tomcat:

2019-1-29 17:23:44 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.32 using APR version 1.5.1.
2019-1-29 17:23:44 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2019-1-29 17:23:44 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:alms-cac' did not find a matching property.
2019-1-29 17:23:44 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized with version OpenSSL 1.0.1j 15 Oct 2014
2019-1-29 17:23:56 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2019-1-29 17:23:56 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2019-1-29 17:23:56 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 12036 ms
2019-1-29 17:23:56 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2019-1-29 17:23:56 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.43
2019-1-29 17:23:56 org.apache.catalina.core.StandardContext resourcesStart
严重: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\Program Files (x86)\apache-tomcat-6.0.43\webapps\alms-cac 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)
2019-1-29 17:23:56 org.apache.catalina.core.StandardContext start
严重: Error in resourceStart()
2019-1-29 17:23:56 org.apache.catalina.core.StandardContext start
严重: Error getConfigured
2019-1-29 17:23:56 org.apache.catalina.core.StandardContext start
严重: Context [/cac] startup failed due to previous errors
2019-1-29 17:23:56 org.apache.catalina.core.StandardContext stop
信息: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cac] has not been started
2019-1-29 17:23:56 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2019-1-29 17:23:56 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2019-1-29 17:23:56 org.apache.catalina.startup.Catalina start
信息: Server startup in 94 ms
2019-1-29 17:24:06 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2019-1-29 17:24:06 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2019-1-29 17:24:06 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2019-1-29 17:24:06 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2019-1-29 17:24:06 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory luceneweb
2019-1-29 17:24:06 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT

这里重点看下这个错误:

严重: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\Program Files (x86)\apache-tomcat-6.0.43\webapps\alms-cac 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)

 

错误提示说,目录“D:\Program Files (x86)\apache-tomcat-6.0.43\webapps\alms-cac”不存在或者不可读,我看了一下webapps下,确实没这个“alms-cac”项目,

严重: Error starting static Resources java.lang.IllegalArgumentException 解决方法_第2张图片

但是却在“D:\Program Files (x86)\apache-tomcat-6.0.43\work\Catalina\localhost”存在一个类似名称的文件夹名,我们知道当tomcat启动后,会把webapps下的项目全部都编译生成临时文件到work目录下,计入webapps下,没有这个cac是怎么知道生成的呢?

严重: Error starting static Resources java.lang.IllegalArgumentException 解决方法_第3张图片

 

网上找了一下,参考https://blog.csdn.net/u013218720/article/details/32112073

说是查看下conf文件夹中的配置文件有相关多余的配置没?

然后就先看了D:\Program Files (x86)\apache-tomcat-6.0.43\conf\Catalina\localhost目录下的文件“host-manager.xml”和"manager.xml"发现没有特殊的配置,准确的说是没找到alms-cac这样的字样

严重: Error starting static Resources java.lang.IllegalArgumentException 解决方法_第4张图片

然后又回退到D:\Program Files (x86)\apache-tomcat-6.0.43\conf文件夹下,发现有几个配置文件如下图

严重: Error starting static Resources java.lang.IllegalArgumentException 解决方法_第5张图片

依次打开查看之后,发现server.xml有情况,如下图

严重: Error starting static Resources java.lang.IllegalArgumentException 解决方法_第6张图片

 

删除该内容之后,也删除work目录中的临时内容,再重启tomcat就正常了。

严重: Error starting static Resources java.lang.IllegalArgumentException 解决方法_第7张图片

 

后续可以关注tomcat目录结构下的相关内容的博客,:-)

你可能感兴趣的:(tomcat)