Previous SpringBoot upgrades have been painless, but our upgrade to 2.5.0 doesn't start. Here's the sort version of the exception:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcMetricsFilter' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'webMvcMetricsFilter' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'prometheusMeterRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.class]: Unsatisfied dependency expressed through method 'prometheusMeterRegistry' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'prometheusConfig' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.class]: Unsatisfied dependency expressed through method 'prometheusConfig' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'management.metrics.export.prometheus-org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusProperties': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusProperties] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@7c0e2abd]
and the very last exception that seems to be causing this whole mess:
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusProperties] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@7c0e2abd]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481)
at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:267)
... 103 common frames omitted
Caused by: java.lang.NoClassDefFoundError: io/micrometer/prometheus/HistogramFlavor
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3244)
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2387)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463)
... 105 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.micrometer.prometheus.HistogramFlavor
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:435)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:590)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:129)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:523)
... 109 common frames omitted
I found this reference: https://github.com/prometheus/client_java/issues/452, and in fact the project includes the dependencies for actuator and micrometer mentioned in that answer. I didn't set this up originally so the interplay between components or how one normally troubleshoots and repairs this kind of thing isn't really clear to me.