Tomcat 6 拒绝有效的 docBase
这是我的 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 安装,没有其他更改。
This is my webapp context file, /etc/tomcat6/Catalina/localhost/ri.xml
<Context docBase="/home/bart/Dropbox/projects/RevoraIndieSite/webapp" reloadable="true">
</Context>
However, Tomcat complains:
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
But the directory exists, and is readable for everyone.
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
It's a default Tomcat 6 installation from the Ubuntu 10.10 repository, with no other changes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
webapp 目录也需要写权限。此外,最好将该目录的所有者设置为运行 tomcat 实例的所有者(如果我没记错的话,就是 ubuntu 上的 tomcat6 用户)
所以尝试
chown -R tomcat6:tomcat6 webapps
或为其他人授予 webapps forlder 写入权限
chmod 766 webapps
webapp directory needs write permisson as well. Furthermore it is a good practice to set owner of this directory as the same that runs tomcat instance (which is tomcat6 user on ubuntu if i am not wrong)
so try
chown -R tomcat6:tomcat6 webapps
or give write permisson to webapps forlder for others
chmod 766 webapps
您可能有一个 ri.xml 文件 &
conf/Catalina/[host]
目录中的 ri 目录,是上次部署尝试留下的。检查并删除它。You may well have a ri.xml file & ri directory in the
conf/Catalina/[host]
directory, left over from a previous deployment attempt. Check for that and delete it.