严重:在Tomcat服务器控制台中启动静态资源时出错

时间:2012-03-07 14:56:09

标签: tomcat

很久以前,我已经部署了一个DWR Webapp示例,我从网上获得了这个示例。 我遇到了问题,我从webapps,temp和localhost文件夹中删除了war文件,但我仍然在启动服务器时在tomcat控制台下获得这些错误

INFO: Initialization processed in 795 ms
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.33
Mar 7, 2012 5:31:25 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor DWR.xml
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Softwares\apache-tomcat-6.0.33\webapps\DWR 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:4320)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4489)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
        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:754)
        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)
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/DWR] startup failed due to previous errors
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/DWR] has not been started
Mar 7, 2012 5:31:25 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor DWRExample.xml
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Softwares\apache-tomcat-6.0.33\webapps\DWRExample 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:4320)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4489)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
        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:754)
        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)
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/DWRExample] startup failed due to previous errors
Mar 7, 2012 5:31:25 PM org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/DWRExample] has not been started
Mar 7, 2012 5:31:25 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml

4 个答案:

答案 0 :(得分:19)

在删除网络应用程序,工作目录和临时目录并看到同样的错误后,我遇到了类似的事情。

记录INFO项之前的第一个SEVERE语句表示已删除的Web应用程序的剩余部分仍作为配置项。

我能够找到嵌套在conf(conf/Catalina/localhost)内部的xml文件,该文件有一个与已删除的Web应用程序关联的xml文件,当我删除它时,错误就消失了。

答案 1 :(得分:7)

幻像项目的上下文正在缓存在工作区插件目录的server.xml中。此过程有助于摆脱SEVERE消息

  1. cd to /path/to/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf
  2. 修改server.xml文件
  3. 在指令内删除<Context>指令,其中docBase属性与您的幻影项目匹配
  4. 在eclipse中重启服务器

答案 2 :(得分:0)

听起来像是缓存在某个地方。除了temp,还要删除整个工作文件夹(在删除之前进行备份)。

答案 3 :(得分:0)

  1. 右键点击项目
  2. 运行,生成资源
  3. 项目清理
  4. 跑步,maven clean或eclipse:clean
  5. 运行,编译
  6. 运行,在服务器上运行