我有一个基于 Maven 的 Spring Boot 项目。尝试运行 SpringBoot 项目时,我不断遇到异常:
javax.management.InstanceNotFoundException: org.springframework.boot:type=Admin,name=SpringApplication
我之前遇到过这个问题几次,但后来它自动消失了,可能是由于系统重新启动或 IDE 重新启动。
但这一次并没有消失。我尝试过使缓存无效并重新启动 IDE。问题仍然存在。我已经尝试了几个在线可用的建议,例如从编辑配置窗口中取消选中启用启动优化和启用 JMX 代理,但仍然没有运气。
IDEA 详细信息: IntelliJ IDEA 2021.1.2(终极版), Build #IU-211.7442.40
我注意到Spring STS 4.10.0.RELEASE中的相同行为,构建 ID:202103111225
同一个项目以前可以正常工作(除了出现这个确切问题但最终可能由于系统重启而失败的几个实例,我真的不确定)。如果我相信我的记忆,我没有对我的 IDE 配置进行任何更改。
下面是抛出的异常:
javax.management.InstanceNotFoundException: org.springframework.boot:type=Admin,name=SpringApplication
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:643)
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1445)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:639)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)