启动tomcat时,java.io.FileNotFoundException: /var/lib/tomcat/webapps/***.war (Permission denied)

启动tomcat,查看catalina.out文件发现有如下报错:

检查一下war包的权限是否正确!!!

(1)当前用户是否有权限权限。(比如 war包所有者和所属组均为root,而当前用户为非root用户)

(2)检查war包的访问权限。一般保证是644即可。chmod -R 644 ***.war

报错日志:

SEVERE: Exception fixing docBase for context [/***]
java.io.FileNotFoundException: /var/lib/tomcat/webapps/***.war (Permission denied)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.(ZipFile.java:219)
        at java.util.zip.ZipFile.(ZipFile.java:149)
        at java.util.jar.JarFile.(JarFile.java:166)
        at java.util.jar.JarFile.(JarFile.java:103)
        at sun.net.www.protocol.jar.URLJarFile.(URLJarFile.java:93)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99)
        at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
        at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89)
        at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:111)
        at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:737)
        at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:862)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:390)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:388)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:144)
        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.deployWAR(HostConfig.java:1092)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

启动tomcat时,java.io.FileNotFoundException: /var/lib/tomcat/webapps/***.war (Permission denied)_第1张图片

你可能感兴趣的:(异常处理)