tomcat報錯總結C:\Program Files\Apache Software Foundation\Tomcat 8.5\logs\catalina.2018-11-07.log (拒絕訪問)
阿新 • • 發佈:2018-12-19
一、錯誤問題
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中 在C:\Program Files中,右鍵–》屬性–》安全–》編輯 在ALL APPLICATION PACKAGES和User(***\Users)中 在下面的許可權中,全部選中。 這樣既可 如果還是有問題,就對裡面的資料夾執行這個操作。
二、錯誤問題
Could not publish server configuration for Tomcat v8.5 Server at localhost. Multiple Contexts have a path of “/jsp01”.
解決方案
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中伺服器重新部署 專案重新部署