I have 2 spring boot applications.
application_A dependsn_on application_B
In fact, each application has a main class marked as @SpringBootApplication
application_B starts successfully, but application_A does not start:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
In debugging, I see spring executing org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration#springApplicationAdminRegistrar twice during startup and not working.
I tried setting the property:
spring.application.admin.enabled=false
But it doesnโt help me.
How can I avoid this exception?
PS
I found this https://github.com/spring-projects/spring-boot/issues/6378 but there is no solution
java spring spring-boot spring-jmx
gstackoverflow
source share