ClassNotFoundException: org/springframework/context/support/LiveBeansView 异常在 STS 中重复抛出

ClassNotFoundException: org/springframework/context/support/LiveBeansView exception is thrown repeatedly in STS

我正在使用 STS 开发一个 jhipster 项目。当我在 STS 中将应用程序作为 spring 启动应用程序启动时,我收到以下异常日志。

2021-05-30 10:57:14.057 DEBUG 13228 --- [on(3)-127.0.0.1] javax.management.mbeanserver : Exception calling isInstanceOf

java.lang.ClassNotFoundException: org/springframework/context/support/LiveBeansView at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:427) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.isInstanceOf(DefaultMBeanServerInterceptor.java:1394) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.isInstanceOf(JmxMBeanServer.java:1091) at java.management/javax.management.InstanceOfQueryExp.apply(InstanceOfQueryExp.java:107) at java.management/javax.management.OrQueryExp.apply(OrQueryExp.java:97) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.objectNamesFromFilteredNamedObjects(DefaultMBeanServerInterceptor.java:1496) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.queryNamesImpl(DefaultMBeanServerInterceptor.java:560) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.queryNames(DefaultMBeanServerInterceptor.java:550) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.queryNames(JmxMBeanServer.java:619) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1485) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.queryNames(RMIConnectionImpl.java:570) at java.base/jdk.internal.reflect.GeneratedMethodAccessor294.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) at java.rmi/sun.rmi.transport.Transport.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(AccessController.java:691) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run[=11=](TCPTransport.java:705) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

2021-05-30 10:57:14.057 DEBUG 13228 --- [on(3)-127.0.0.1] javax.management.mbeanserver : Exception calling isInstanceOf

java.lang.ClassNotFoundException: org/springframework/boot/actuate/endpoint/jmx/EndpointMBean at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:427) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.isInstanceOf(DefaultMBeanServerInterceptor.java:1394) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.isInstanceOf(JmxMBeanServer.java:1091) at java.management/javax.management.InstanceOfQueryExp.apply(InstanceOfQueryExp.java:107) at java.management/javax.management.OrQueryExp.apply(OrQueryExp.java:97) at java.management/javax.management.OrQueryExp.apply(OrQueryExp.java:97) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.objectNamesFromFilteredNamedObjects(DefaultMBeanServerInterceptor.java:1496) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.queryNamesImpl(DefaultMBeanServerInterceptor.java:560) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.queryNames(DefaultMBeanServerInterceptor.java:550) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.queryNames(JmxMBeanServer.java:619) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1485) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.queryNames(RMIConnectionImpl.java:570) at java.base/jdk.internal.reflect.GeneratedMethodAccessor294.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) at java.rmi/sun.rmi.transport.Transport.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(AccessController.java:691) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run[=11=](TCPTransport.java:705) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

2021-05-30 10:57:14.057 DEBUG 13228 --- [on(3)-127.0.0.1] javax.management.mbeanserver : Exception calling isInstanceOf

java.lang.ClassNotFoundException: org/springframework/boot/actuate/endpoint/jmx/DataEndpointMBean at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:427) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.isInstanceOf(DefaultMBeanServerInterceptor.java:1394) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.isInstanceOf(JmxMBeanServer.java:1091) at java.management/javax.management.InstanceOfQueryExp.apply(InstanceOfQueryExp.java:107) at java.management/javax.management.OrQueryExp.apply(OrQueryExp.java:97) at java.management/javax.management.OrQueryExp.apply(OrQueryExp.java:97) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.objectNamesFromFilteredNamedObjects(DefaultMBeanServerInterceptor.java:1496) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.queryNamesImpl(DefaultMBeanServerInterceptor.java:560) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.queryNames(DefaultMBeanServerInterceptor.java:550) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.queryNames(JmxMBeanServer.java:619) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1485) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.queryNames(RMIConnectionImpl.java:570) at java.base/jdk.internal.reflect.GeneratedMethodAccessor294.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) at java.rmi/sun.rmi.transport.Transport.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(AccessController.java:691) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run[=11=](TCPTransport.java:705) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

但如果我在命令提示符下启动应用程序,则没有例外。这让我想知道这是否是 STS 中的问题。有人可以帮忙吗?

这些是 DEBUG 日志语句并与 JMX 相关,因此您可以通过在 logback-spring.xml[=11= 中的“javax.management”上将日志级别设置为 WARN 或 INFO 来在开发中安全地忽略它们]

<logger name="javax.management" level="WARN"/>

只是 MBean 服务器尝试实例化一些 classes 以查看它是否必须通过 JMX 公开它们,如果缺少 class 则不是问题。

为什么它在 STS 中有所不同?我不知道,但可能是 STS 配置日志记录的方式不同。不幸的是,STS 或纯 Eclipse 并未在 JHipster 社区中广泛使用。