tomcat报错总结C:\Program Files\Apache Software Foundation\Tomcat 8.5\logs\catalina.2018-11-07.log (拒绝访问)

错误问题一

java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 8.5\logs\catalina.2018-11-07.log (拒绝访问。)

1、错误日志

java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 8.5\logs\catalina.2018-11-07.log (拒绝访问。)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at org.apache.juli.FileHandler.openWriter(FileHandler.java:504)
        at org.apache.juli.FileHandler.<init>(FileHandler.java:176)
        at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:82)
        at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:74)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:601)
        at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:538)
        at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:336)
        at java.util.logging.LogManager$3.run(LogManager.java:399)
        at java.util.logging.LogManager$3.run(LogManager.java:396)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
        at java.util.logging.LogManager.access$800(LogManager.java:145)
        at java.util.logging.LogManager$2.run(LogManager.java:345)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
        at java.util.logging.LogManager.getLogManager(LogManager.java:378)
        at java.util.logging.Logger.demandLogger(Logger.java:448)
        at java.util.logging.Logger.getLogger(Logger.java:502)
        at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:68)
        at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:188)
        at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:117)
        at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:141)
        at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:196)
        at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)

2、问题分析

权限问题。

3、问题解决

进入tomcat的安装路径
我的在C:\Program Files\Apache Software Foundation中
对文件夹Apache Software Foundation,右键–》属性–》安全–》编辑
在ALL APPLICATION PACKAGES和User(***\Users)中
在下面的权限中,全部选中。
tomcat报错总结C:\Program Files\Apache Software Foundation\Tomcat 8.5\logs\catalina.2018-11-07.log (拒绝访问)_第1张图片
这样既可
如果还是有问题,就对里面的文件夹执行这个操作。

错误问题二

Could not publish server configuration for Tomcat v8.5 Server at localhost.
Multiple Contexts have a path of “/jsp01”.
tomcat报错总结C:\Program Files\Apache Software Foundation\Tomcat 8.5\logs\catalina.2018-11-07.log (拒绝访问)_第2张图片

解决方案

if:使用的eclipse tomcat 插件

在工作空间 workspace找到如下文件:
.metadata.plugins\org.eclipse.wst.server.core\tmp0\conf中的server.xml
或者
.metadata.plugins\org.eclipse.wst.server.core\tmp1\conf中的server.xml

if:使用自己安装的tomcat服务器

在Tomcat的安装目录下的\conf\server.xml中

将标签所对应的重复名称项目删除
将下面的这两个删掉

<Context docBase="jsp01" path="/jsp01" reloadable="true" source="org.eclipse.jst.jee.server:jsp01"/>
<Context docBase="jsp01" path="/jsp01" reloadable="true" source="org.eclipse.jst.jee.server:jsp01"/>

在eclipse中服务器重新部署
项目重新部署

你可能感兴趣的:(项目总结)