1

我已经在文件夹中部署了一些项目tomcat7并将它们webappswork文件夹中删除,但是当尝试部署一些新项目时,因为war to webapps它没有被提取,并且所有以前的项目文件夹都存在于工作文件夹中,这会造成一些问题。

所以请告诉我如何从tomcat7中完全删除旧项目?

引用甚至不存在的文件夹的日志文件

   SEVERE: Error starting static Resources
    java.lang.IllegalArgumentException: Document base D:\netbeans_workspace\Servlets-DWR\build\web does not exist or is not a readable directory


Jul 13, 2012 2:38:07 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\netbeans_workspace\Servlets-DWR\build\web does not exist or is not a readable directory
        at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)
        at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4894)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5074)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Jul 13, 2012 2:38:07 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error in resourceStart()
Jul 13, 2012 2:38:07 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Jul 13, 2012 2:38:07 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Servlets-DWR] startup failed due to previous errors
Jul 13, 2012 2:38:07 PM org.apache.catalina.deploy.NamingResources cleanUp
WARNING: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost
[localhost].StandardContext[/Servlets-DWR]] so no cleanup was performed for that container
javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [co
mp].
        at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
        at org.apache.catalina.deploy.NamingResources.cleanUp(NamingResources.java:977)
        at org.apache.catalina.deploy.NamingResources.stopInternal(NamingResources.java:959)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5483)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Jul 13, 2012 2:38:07 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor D:\Servers\apache-tomcat-7.0.27\conf\Catalina\localhost\Sli
ngeLeaveNotifier.xml
Jul 13, 2012 2:38:07 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\netbeans_workspace\SlingeLeaveNotifier\build\we
b does not exist or is not a readable directory
        at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)
        at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4894)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5074)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Jul 13, 2012 2:38:07 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error in resourceStart()
Jul 13, 2012 2:38:07 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Jul 13, 2012 2:38:07 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/SlingeLeaveNotifier] startup failed due to previous errors
Jul 13, 2012 2:38:07 PM org.apache.catalina.deploy.NamingResources cleanUp
WARNING: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost
[localhost].StandardContext[/SlingeLeaveNotifier]] so no cleanup was performed for that container
javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [co
mp].
        at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
        at org.apache.catalina.deploy.NamingResources.cleanUp(NamingResources.java:977)
        at org.apache.catalina.deploy.NamingResources.stopInternal(NamingResources.java:959)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5483)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Jul 13, 2012 2:38:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Servers\apache-tomcat-7.0.27\webapps\docs
Jul 13, 2012 2:38:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Servers\apache-tomcat-7.0.27\webapps\examples
Jul 13, 2012 2:38:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Servers\apache-tomcat-7.0.27\webapps\host-manager
Jul 13, 2012 2:38:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Servers\apache-tomcat-7.0.27\webapps\manager
Jul 13, 2012 2:38:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Servers\apache-tomcat-7.0.27\webapps\ROOT
Jul 13, 2012 2:38:07 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Jul 13, 2012 2:38:07 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Jul 13, 2012 2:38:07 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4251 ms

问候

4

5 回答 5

3

我今天解决了一个类似的问题:

tomcatHome/conf/Catalina/localhost我有两个应用程序 xml 文件。

在每个文件中声明了一个资源:这两个资源具有相同的名称。

我更改了两个资源之一的名称,一切正常。

于 2012-12-17T13:50:00.860 回答
1

我没有在我的工作计算机上安装 Tomcat7,但我在我的 Tomcat6 中查找。在程序文件夹中应该退出一个 webapps 文件夹,也许还有一个工作文件夹。进入最后一个并搜索您的应用程序。显然,服务器将您的战争文件提取到其中。

于 2012-07-13T08:43:49.137 回答
1

在 Tomcat 目录中,您可以找到 conf/context.xml 文件,其中包含在其他位置的部署描述。如果您从 IDE 启动 Tomcat,例如从 Eclipse,您可以在服务器视图中找到应用程序和工作目录的配置。

于 2012-07-13T08:50:00.493 回答
1

跟着这些步骤:

  1. 删除Servlets-DWR.xml可以在下面找到的文件tomcatHome/conf/Catalina/localhost
  2. 将你的war文件复制到webapps目录
  3. 重启Tomcat

希望这可以帮助!

于 2012-07-13T09:07:43.777 回答
0

我解决了一个类似的问题,因为文件“tomcatHome/conf/Catalina/localhost/app.xml”有一些错误的配置。标签<Context path="/app1" ......>,你可以发现路径的内容和我的项目名称不一样。当我更改为相同时,一切正常。

于 2014-07-31T02:59:54.090 回答