Can't load log handler "1catalina.org.apache.juli.FileHandler" 原因分析及解决

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=64M; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Can't load log handler "1catalina.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.util.logging.LogManager$5.run(LogManager.java:965)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:958)
    at java.util.logging.LogManager.addLogger(LogManager.java:1165)
    at java.util.logging.LogManager$2.run(LogManager.java:349)
    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:71)
    at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:178)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
    at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:241)
    at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:296)
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54)
Can't load log handler "1catalina.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler

 

在启动的时候报改错,故尝试定位启动脚本catalina.sh。发现

显然,JAVA_OPTS属性会被覆盖,从而导致类无法加载,注释掉 193 行即可解决。

Microsoft Windows [版本 10.0.19045.5608] (c) Microsoft Corporation。保留所有权利。 C:\Users\XIN>catalina.bat run Using CATALINA_BASE: "C:\Program Files\apache-tomcat-9.0.97" Using CATALINA_HOME: "C:\Program Files\apache-tomcat-9.0.97" Using CATALINA_TMPDIR: "C:\Program Files\apache-tomcat-9.0.97\temp" Using JRE_HOME: "C:\Program Files\Java\jdk-17" Using CLASSPATH: "C:\Program Files\apache-tomcat-9.0.97\bin\bootstrap.jar;C:\Program Files\apache-tomcat-9.0.97\bin\tomcat-juli.jar" Using CATALINA_OPTS: "" NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED java.util.logging.ErrorManager: 4 java.io.FileNotFoundException: C:\Program Files\apache-tomcat-9.0.97\logs\catalina.2025-03-23.log (拒绝访问。) at java.base/java.io.FileOutputStream.open0(Native Method) at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293) at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235) at org.apache.juli.FileHandler.openWriter(FileHandler.java:447) at org.apache.juli.FileHandler.<init>(FileHandler.java:121) at org.apache.juli.FileHandler.<init>(FileHandler.java:108) at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:79) at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:74) at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:70) at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:66) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructo
最新发布
03-24
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

算法小生Đ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值