Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in Spring Boot app - Unable to map duplicate endpoint operations: [MBean call 'topology'] to topologyEndpoint

When I try to start my Spring Boot Service I get the error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmxMBeanExporter' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.jmx.JmxEndpointExporter]: Factory method 'jmxMBeanExporter' threw exception; nested exception is java.lang.IllegalStateException: Unable to map duplicate endpoint operations: [MBean call 'topology'] to topologyEndpoint
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:882)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
    at com.quest.orbital.group.service.Application.main(Application.java:41)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.jmx.JmxEndpointExporter]: Factory method 'jmxMBeanExporter' threw exception; nested exception is java.lang.IllegalStateException: Unable to map duplicate endpoint operations: [MBean call 'topology'] to topologyEndpoint
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651)
    ... 19 common frames omitted
Caused by: java.lang.IllegalStateException: Unable to map duplicate endpoint operations: [MBean call 'topology'] to topologyEndpoint
    at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.assertNoDuplicateOperations(EndpointDiscoverer.java:231)
    at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.convertToEndpoint(EndpointDiscoverer.java:198)
    at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.convertToEndpoints(EndpointDiscoverer.java:179)
    at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.discoverEndpoints(EndpointDiscoverer.java:124)
    at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.getEndpoints(EndpointDiscoverer.java:116)
    at org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration.jmxMBeanExporter(JmxEndpointAutoConfiguration.java:95)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    ... 20 common frames omitted

I use Spring Boot, WebFlux. I was able to start my service a couple of days ago but today - with this error. My service compiles without any problems. I don't have any duplicated endpoints in my cotrollers. I use OPENAPI to generate controllers.

Do you have any idea? What informations should I add to this post? I don't have any idea what's the problem:(

I cleaned the Gradle caches, removed everything and cloned the repo one more time. It seems that it must be a problem on my laptop? The only thing I changed recently was starting Kubernetes on Docker Desktop (win10 pro) but other services start without problems...

like image 711
Matley Avatar asked May 10 '20 12:05

Matley


People also ask

How to add mapping DTOs in Spring Boot with mapstruct?

Mapping DTOs in Spring Boot with MapStruct 1 Building the Project. We will also add the annotationProcessorPaths section to the configuration part of the... 2 Running the application. 3 MapStruct generated Mapping. As you can see, the mapping between source and target classes is straightforward. In some... More ...

How to map error page to /error in Spring Boot?

By default Spring Boot maps /error to BasicErrorController which populates model with error attributes and then returns 'error' as the view name to map application defined error pages. To replace BasicErrorController with our own custom controller which can map to '/error', we need to implement ErrorController interface.

What are the dependencies and technologies used in Spring Boot?

Dependencies and Technologies Used: spring-boot-starter-web : Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat as the default embedded container.

How to add an application class to bootstrap a Spring Boot example?

Complete the example adding an Application class to bootstrap the example: To build the example, we will add the required MapStruct and Lombok dependencies, plus the default SpringBoot starter libraries: We will also add the annotationProcessorPaths section to the configuration part of the maven-compiler-plugin plugin.


1 Answers

The answer is Intellij in my case - after recent update I had to uncheck Enable JMX agent in Project Configurations

enter image description here

enter image description here

like image 169
Matley Avatar answered Oct 03 '22 04:10

Matley