spring-projects / spring-projects/spring-boot
Check if it's possible to start Spring Boot on a JVM that doesn't have JMX
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
If you run in a restricted JVM that has no JMX, Micrometer falls in a heap:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.management.ManagementFactoryHelper
at java.lang.management.ManagementFactory.getMemoryPoolMXBeans(ManagementFactory.java:387) ~[na:1.8.0_102-internal]
at io.micrometer.core.instrument.binder.jvm.JvmGcMetrics.<init>(JvmGcMetrics.java:76) ~[micrometer-core-1.3.2.jar!/:1.3.2]
at io.micrometer.core.instrument.binder.jvm.JvmGcMetrics.<init>(JvmGcMetrics.java:72) ~[micrometer-core-1.3.2.jar!/:1.3.2]
at org.springframework.boot.actuate.autoconfigure.metrics.JvmMetricsAutoConfiguration.jvmGcMetrics(JvmMetricsAutoConfiguration.java:48) ~[spring-boot-actuator-autoconfigure-2.2.4.RELEASE.jar!/:2.2.4.RELEASE]
Seems like we could be more defensive, but this is probably not the end of the problem. E.g. I found (from running the Petlinic in Tiny Core Linux) that eh-cache fails in the same way. Also webjars locator has an out of date dependency on the classgraph dependency, and that fails unless you update it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the stack trace through io.micrometer.core.instrument.binder.jvm.JvmGcMetrics and org.springframework.boot.actuate.autoconfigure.metrics.JvmMetricsAutoConfiguration, then reproduce startup on a JVM without JMX. Investigate the related eh-cache and webjars locator failures mentioned in the issue, and define done as establishing the supported behavior and affected startup paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100