generator-jhipster: ClassNotFoundException for EndpointMBean, DataEndpointMBean and LiveBeansView

I am getting ClassNotFoundExceptions when running a freshly generated, unmodified JHipster project on Windows using JDK 11.0.3

EndpointMBean, DataEndpointMBean and LiveBeansView are all showing up as class not found when running ./gradlew.bat

This could be a Spring Boot issue that was raised here by someone else: https://github.com/spring-projects/spring-boot/issues/16806

Code to reproduce the issue is at https://github.com/sometxdude/issue-16806-example

Its not a showstopper as the app still functions, but the stacktraces litter up the console pretty bad.

An example stacktrace: 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:398) 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.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 17 (8 by maintainers)

Most upvoted comments

This issue drove me crazy for an hour, until I finally understand what’s going on (and why @pascalgrimaud couldn’t reproduce this issue 😉 ). This actually a feature of Spring Boot Tools! It tries to detect the beans which are running in Spring applications (why, I don’t know … ), and thinks, that connecting to a Java application is perfectly fine thing to do over JMX. To disable this, in open the Preferences > Spring Boot Lanuage Server and uncheck the ‘Live information - Automatic Process Tracking Enabled’ switch. And no more annoying exceptions!

FWIW: I had a similar issue. Following this response: https://stackoverflow.com/a/45102852 , I cleared my .m2 folder and it solved the issue. I suspect there was an issue with the proxy server when initially downloading dependencies.

It seems your JDK is from Oracle, could you try with the one from : https://adoptopenjdk.net/