Tomcat报错java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler

时间:2023-12-22 10:29:02
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$1.run(URLClassLoader.java:200)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.util.logging.LogManager$3.run(LogManager.java:359)
at java.util.logging.LogManager.addLogger(LogManager.java:352)
at java.util.logging.LogManager$1.run(LogManager.java:180)
at java.util.logging.LogManager.<clinit>(LogManager.java:156)
at java.util.logging.Logger.getLogger(Logger.java:274)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
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$1.run(URLClassLoader.java:200)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.util.logging.LogManager$7.run(LogManager.java:894)
at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:887)
at java.util.logging.LogManager.access$900(LogManager.java:129)
at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:984)
at java.util.logging.LogManager$3.run(LogManager.java:377)
at java.util.logging.LogManager.addLogger(LogManager.java:352)
at java.util.logging.LogManager$1.run(LogManager.java:180)
at java.util.logging.LogManager.<clinit>(LogManager.java:156)
at java.util.logging.Logger.getLogger(Logger.java:274)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
Can't load log handler "2localhost.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.util.logging.LogManager$7.run(LogManager.java:894)
at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:887)
at java.util.logging.LogManager.access$900(LogManager.java:129)
at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:984)
at java.util.logging.LogManager$3.run(LogManager.java:377)
at java.util.logging.LogManager.addLogger(LogManager.java:352)
at java.util.logging.LogManager$1.run(LogManager.java:180)
at java.util.logging.LogManager.<clinit>(LogManager.java:156)
at java.util.logging.Logger.getLogger(Logger.java:274)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
Can't load log handler "3manager.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 3manager.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 3manager.org.apache.juli.FileHandler
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.util.logging.LogManager$7.run(LogManager.java:894)
at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:887)
at java.util.logging.LogManager.access$900(LogManager.java:129)
at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:984)
at java.util.logging.LogManager$3.run(LogManager.java:377)
at java.util.logging.LogManager.addLogger(LogManager.java:352)
at java.util.logging.LogManager$1.run(LogManager.java:180)
at java.util.logging.LogManager.<clinit>(LogManager.java:156)
at java.util.logging.Logger.getLogger(Logger.java:274)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
Can't load log handler "4host-manager.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 4host-manager.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 4host-manager.org.apache.juli.FileHandler
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.util.logging.LogManager$7.run(LogManager.java:894)
at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:887)
at java.util.logging.LogManager.access$900(LogManager.java:129)
at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:984)
at java.util.logging.LogManager$3.run(LogManager.java:377)
at java.util.logging.LogManager.addLogger(LogManager.java:352)
at java.util.logging.LogManager$1.run(LogManager.java:180)
at java.util.logging.LogManager.<clinit>(LogManager.java:156)
at java.util.logging.Logger.getLogger(Logger.java:274)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)

某站点突然不能访问,启动报以上错误,经查,有人改动了catalina.sh文件:

export JAVA_OPTS="-server -Xms8G -Xmx8G"

if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
else
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
fi

其中,export JAVA_OPTS="-server -Xms8G -Xmx8G"这句不能放在-Djava.util.logging.manager后面,改到前面即可。

修改保存,重启,不再报错。