简体   繁体   English

文档库/ home / ec2-user / myproject / web不存在或不是可读目录

[英]Document base /home/ec2-user/myproject/web does not exist or is not a readable directory

I am deploying my project to AWS with Apache Tomcat 7. I added the ROOT.xml into Catalina/localhost/ like this 我正在使用Apache Tomcat 7将项目部署到AWS。我将ROOT.xml像这样添加到Catalina/localhost/

<Context
 path="/"
 docBase="/home/ec2-user/myproject/web"
 workDir="/home/ec2-user/myproject/work"
 crossContext="true">
</Context>

Starting Tomcat gives me the famous exception of Tomcat, but sadly, I cannot resolve it 启动Tomcat给了我Tomcat一个著名的例外,但是可惜我无法解决它

java.lang.IllegalArgumentException: Document base /home/ec2-user/myproject/web does not exist or is not a readable directory
        at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:136)
        at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5247)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5436)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
        at java.lang.Thread.run(Thread.java:748)

Things I tried: 我尝试过的事情:

  • sudo chown -R tomcat:tomcat web && sudo chmod 775 -R web (Does not work) sudo chown -R tomcat:tomcat web && sudo chmod 775 -R web (不起作用)
  • sudo ln -s web /etc/tomcat/web (Does not work) sudo ln -s web /etc/tomcat/web (不起作用)
  • sudo cp -rf web /etc/tomcat/web (Work, actually, if I move the web folder anywhere outside of /home/ec2-user , it starts to work) sudo cp -rf web /etc/tomcat/web (工作,实际上,如果我将web文件夹移动到/home/ec2-user之外的任何地方,它将开始工作)

How can I make this work with the web folder under the ec2-user ? 如何使用ec2-user下的web文件夹进行此项工作?

Problem solved. 问题解决了。 Edit /etc/tomcat7/tomcat7.conf from 从以下位置编辑/etc/tomcat7/tomcat7.conf

TOMCAT_USER="tomcat"

to

TOMCAT_USER="root"

Not the best way, but I can continue my work now 这不是最好的方法,但是我现在可以继续工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.io.FileNotFoundException:/home/ec2-user/src/main/resources/keystore.jks(无此类文件或目录) - java.io.FileNotFoundException: /home/ec2-user/src/main/resources/keystore.jks (No such file or directory) java.lang.IllegalArgumentException:文档库tomcat \ webapps \ appdata不存在或不是可读目录 - java.lang.IllegalArgumentException: Document base tomcat\webapps\appdata does not exist or is not a readable directory IllegalArgumentException:文档库\\ .metadata \\ .plugins \\ org.eclipse.wst.server.core \\ tmp0 \\ wtpwebapps不存在或不是可读目录 - IllegalArgumentException: Document base \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps does not exist or is not a readable directory 主页目录不存在JBOSS - Home directory does not exist JBOSS 主目录不存在或缺少run.jar - The home directory does not exist or is missing the run.jar javac错误:包com.myproject.planets不存在 - javac error: package com.myproject.planets does not exist Tomcat7服务器错误,目录中不存在文件或可读目录 - Tomcat7 server error, file not exist in directory or not a readable directory FileWriter不存在目录 - Directory does not exist with FileWriter GWT_HOME不存在(mac 10.8.3) - GWT_HOME does not exist (mac 10.8.3) 包sun.security.ec不存在 - package sun.security.ec does not exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM