Tomcat 6拒绝使用有效的docBase

时间:2011-04-28 21:48:44

标签: java tomcat servlets tomcat6

这是我的webapp上下文文件, /etc/tomcat6/Catalina/localhost/ri.xml

<Context docBase="/home/bart/Dropbox/projects/RevoraIndieSite/webapp" reloadable="true">

</Context>

然而,Tomcat抱怨道:

INFO: Deploying configuration descriptor ri.xml
28-Apr-2011 23:44:04 org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base /home/bart/Dropbox/projects/RevoraIndieSite/webapp 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:4249)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4418)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
    at java.lang.Thread.run(Thread.java:636)
28-Apr-2011 23:44:04 org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
28-Apr-2011 23:44:04 org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
28-Apr-2011 23:44:04 org.apache.catalina.core.StandardContext start
SEVERE: Context [/ri] startup failed due to previous errors
28-Apr-2011 23:44:04 org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ri] has not been started

但该目录存在,并且对所有人都可读。

bart@bart-laptop:~$ ls -l /home/bart/Dropbox/projects/RevoraIndieSite
total 36
drwxr-xr-x 3 bart bart 4096 2011-04-20 20:46 bin
drwxr-xr-x 3 bart bart 4096 2011-04-27 23:11 bin-tools
-rw-r--r-- 1 bart bart  971 2011-04-27 23:15 build.xml
drwxr-xr-x 4 bart bart 4096 2011-03-30 22:42 export
-rw-r--r-- 1 bart bart  290 2011-03-30 22:36 ivysettings.xml
-rw-r--r-- 1 bart bart 1214 2011-04-27 23:08 ivy.xml
drwxr-xr-x 4 bart bart 4096 2011-04-28 23:33 src
drwxr-xr-x 3 bart bart 4096 2011-04-27 22:09 src-tools
drwxr-xr-x 3 bart bart 4096 2011-02-27 17:33 webapp

这是来自Ubuntu 10.10存储库的默认Tomcat 6安装,没有其他更改。

2 个答案:

答案 0 :(得分:0)

webapp目录也需要写入权限。此外,将此目录的所有者设置为运行tomcat实例(如果我没有错,则是ubuntu上的tomcat6用户)是一个好习惯。 所以试试 chown -R tomcat6:tomcat6 webapps
或者为其他人提供写入权限给webapps forlder chmod 766 webapps

答案 1 :(得分:0)

你可能有一个ri.xml文件&amp; conf/Catalina/[host]目录中的ri目录,从先前的部署尝试中遗留下来。检查并删除它。