tomact正常启动,但是在日志文件报错java.lang.NoClassDefFoundError: java/util/logging/Logger

启动tomcat,显示正常启动

tomcat这个小人,表面上

Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/java/jdk-13.0.2/
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.

但是查看logs下的cata***
发现如下报错

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.rmi/sun.rmi.transport=ALL-UNNAMED
WARNING: Unknown module: java.rmi specified to --add-opens
Exception in thread "main" java.lang.NoClassDefFoundError: java/util/logging/Logger
        at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:61)
        at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:181)
        at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:116)
        at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:139)
        at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:194)
        at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)
Caused by: java.lang.ClassNotFoundException: java.util.logging.Logger
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 6 more

找了好久,最后发现是jre的问题。

# 从JDK9开始, 引入了模块化, 可以根据自己的需要生成一个runtime, 所以就不再单独提供jre了, 你需要什么模块, 自己生成就好了, 可以自己定制jre的. https://www.zhihu.com/question/352542780/answer/872011539

# 我这里没有生成jre, 只是在/etc/profile文件中指定jre的位置为jdk的位置, tomcat启动失败的问题解决! 


# /etc/profile文件末添加如下, 解决jre找不到的问题
JAVA_HOME=/usr/app/jdk-11.0.1/
JRE_HOME=$JAVA_HOME
CLASSPATH=$JAVA_HOME/lib
PATH=$JRE_HOME/bin:$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME CLASSPATH

原文链接

Tomcat启动报错,求教 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/fwpt]] at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1119) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/fwpt]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) ... 6 more Caused by: java.lang.NoClassDefFoundError: LLogger; at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2583) at java.lang.Class.getDeclaredFields(Class.java:1916) at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106) at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:139) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65) at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:417) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:891) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 6 more # **Caused by: java.lang.ClassNotFoundException: Logger** at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735) ... 20 more
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页