I just moved up to spring-boot2 and cannot seem to remove the runtime errors related to AbstractEndpoint. Answers I have read seem to indicate that making the actuator version and micrometer-registry-prometheus compatibly will solve the problem. I did that but it doesn't seem to make any difference. stacktrace below and gradle file below it.
2022-11-06 11:38:59.490 ERROR 92504 --- [ main] o.s.boot.SpringApplication : Application run failed 11:38:59.490 [QUIET] [system.out] 11:38:59.490 [QUIET] [system.out] java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration.propertySourcesPlaceholderConfigurer 11:38:59.490 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.490 [QUIET] [system.out] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.490 [QUIET] [system.out] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:181) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.490 [QUIET] [system.out] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:141) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.490 [QUIET] [system.out] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.490 [QUIET] [system.out] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.491 [QUIET] [system.out] at com.inauth.gdis.Application.main(Application.java:19) [main/:na] 11:38:59.491 [QUIET] [system.out] Caused by: java.lang.IllegalStateException: Failed to introspect Class [io.prometheus.client.spring.boot.PrometheusEndpointConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader@4e0e2f2a] 11:38:59.491 [QUIET] [system.out] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:507) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:404) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:389) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:447) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_292] 11:38:59.491 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:736) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:677) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.491 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:646) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1524) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1029) ~[spring-beans-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:189) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:156) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanType(BeanTypeRegistry.java:149) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:137) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[na:1.8.0_292] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:132) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:96) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:269) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:262) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:251) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:171) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:145) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-2.1.18.RELEASE.jar:2.1.18.RELEASE] 11:38:59.492 [QUIET] [system.out] ... 15 common frames omitted 11:38:59.492 [QUIET] [system.out] Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/actuate/endpoint/AbstractEndpoint 11:38:59.492 [QUIET] [system.out] at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_292] 11:38:59.492 [QUIET] [system.out] at java.lang.ClassLoader.defineClass(ClassLoader.java:756) ~[na:1.8.0_292] 11:38:59.492 [QUIET] [system.out] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_292] 11:38:59.492 [QUIET] [system.out] at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_292] 11:38:59.493 [QUIET] [system.out] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE] 11:38:59.493 [QUIET] [system.out] ... 37 common frames omitted 11:38:59.493 [QUIET] [system.out] Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.AbstractEndpoint
my gradle file below:
plugins {
id "java"
id "org.springframework.boot" version "2.1.18.RELEASE"
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
jar {
baseName = 'gdis-server'
version = '1.0.0'
}
repositories {
mavenCentral()
jcenter()
maven {
credentials {
username project.'artifactory.publish.username'
password project.'artifactory.publish.password'
}
url project.'resolve.url'
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation("org.springframework.boot:spring-boot-starter-test")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation ("org.springframework.boot:spring-boot-starter-actuator") {
exclude group: 'io.micrometer', module: 'micrometer-core'
}
implementation 'io.micrometer:micrometer-registry-prometheus:1.0.3'
// implementation group: 'io.micrometer', name: 'micrometer-spring-legacy', version: '1.3.20'
implementation 'io.prometheus:simpleclient:0.16.0'
implementation 'io.prometheus:simpleclient_hotspot:0.16.0'
implementation 'io.prometheus:simpleclient_spring_boot:0.16.0'
implementation 'io.prometheus:simpleclient_servlet:0.16.0'
I tried many versions of the prometheus simple-client libs but cannot seem to get rid of that stack trace.