1.开发环境:
环境:myeclipse2015+tomcat7+win10
2.异常:
偶尔在部署项目的时候回发现tomcat7部署后配置文件按照路径居然找不到自己的项目。httP://localhost:80,都无法访问。具体错误信息如下,在tomcat的配置文件server.xml中发现context标签内一切正常
<Context docBase="F:\Tomcat7.0\me-webapps\esignmanage" path="/esignmanage" reloadable="true" source="org.eclipse.jst.jee.server:esignmanage"/></Host>,然后通过查找其他配置文件,在tomcat7的conf->catalina->localhost中找到了对应当前项目的xml配置文件,其中context标签终于找到了异常所在。
<Context docBase="F:\Tomcat7.0\me-webapps\Tomcat7.0\me-webapps\esignmanage" path="/esignmanage" reloadable="true" source="org.eclipse.jst.jee.server:esignmanage"/>
,然后删除tomcat7下的work目录即可恢复。
1 十二月 15, 2015 9:42:57 上午 org.apache.catalina.core.AprLifecycleListener init 2 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_51\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.7.0_51\jre\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_51\bin;D:\Developer\apache-maven-3.3.3\bin;C:\Program Files\TortoiseGit\bin;D:\Developer\SSH;. 3 十二月 15, 2015 9:42:58 上午 org.apache.coyote.AbstractProtocol init 4 信息: Initializing ProtocolHandler ["http-bio-80"] 5 十二月 15, 2015 9:42:58 上午 org.apache.coyote.AbstractProtocol init 6 信息: Initializing ProtocolHandler ["ajp-bio-8009"] 7 十二月 15, 2015 9:42:58 上午 org.apache.catalina.startup.Catalina load 8 信息: Initialization processed in 644 ms 9 十二月 15, 2015 9:42:58 上午 org.apache.catalina.core.StandardService startInternal 10 信息: Starting service Catalina 11 十二月 15, 2015 9:42:58 上午 org.apache.catalina.core.StandardEngine startInternal 12 信息: Starting Servlet Engine: Apache Tomcat/7.0.27 13 十二月 15, 2015 9:42:58 上午 org.apache.catalina.startup.HostConfig deployDescriptor 14 信息: Deploying configuration descriptor F:\Tomcat7.0\conf\Catalina\localhost\esignmanage.xml 15 十二月 15, 2015 9:42:58 上午 org.apache.catalina.startup.SetContextPropertiesRule begin 16 警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:esignmanage' did not find a matching property. 17 十二月 15, 2015 9:42:58 上午 org.apache.catalina.core.StandardContext resourcesStart 18 严重: Error starting static Resources 19 java.lang.IllegalArgumentException: Document base F:\Tomcat7.0\me-webapps\Tomcat7.0\me-webapps\esignmanage does not exist or is not a readable directory 20 at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140) 21 at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4894) 22 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5074) 23 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 24 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895) 25 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871) 26 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) 27 at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649) 28 at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585) 29 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 30 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 31 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 32 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 33 at java.lang.Thread.run(Thread.java:744) 34 十二月 15, 2015 9:42:58 上午 org.apache.catalina.core.StandardContext startInternal 35 严重: Error in resourceStart() 36 十二月 15, 2015 9:42:58 上午 org.apache.catalina.core.StandardContext startInternal 37 严重: Error getConfigured 38 十二月 15, 2015 9:42:58 上午 org.apache.catalina.core.StandardContext startInternal 39 严重: Context [/esignmanage] startup failed due to previous errors 40 十二月 15, 2015 9:42:58 上午 org.apache.catalina.startup.HostConfig deployDirectory 41 信息: Deploying web application directory F:\Tomcat7.0\webapps\ROOT 42 十二月 15, 2015 9:42:58 上午 org.apache.coyote.AbstractProtocol start 43 信息: Starting ProtocolHandler ["http-bio-80"] 44 十二月 15, 2015 9:42:58 上午 org.apache.coyote.AbstractProtocol start 45 信息: Starting ProtocolHandler ["ajp-bio-8009"] 46 十二月 15, 2015 9:42:58 上午 org.apache.catalina.startup.Catalina start 47 信息: Server startup in 467 ms