BeanDefinitionStoreException on sentry-spring-boot-starter

Hey guys, I’m trying to add sentry-spring-boot-starter on my application (which has spring-boot 2.1.7.RELEASE) but when I start my application I get the following error:

org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'sentryHub' defined in class path resource [io/sentry/spring/boot/SentryAutoConfiguration$HubConfiguration.class]: @Bean definition illegally overridden by existing bean definition: Generic bean: class [io.sentry.HubAdapter]

Looking into the documentation for spring-boot I couldn’t find anything about this exception nor about some property that I have to include in order for it to work. Am I missing something on my configuration?

Besides I can’t find any documentation about the older versions of sentry-spring-boot-starter. Where can I find it?

This means that there are two beans with the same name. Read more

Seems like you have already bean “sentryHub” registered. Perhaps you have used @EnableSentry and Sentry Spring Boot Starter? With Spring Boot integration, you should not use @EnableSentry as all required beans are auto-configured.

Thanks a lot! It solved the problem! I think I’ve merged the configurations from sentry-spring and sentry-spring-boot-starter hence the @EnableSentry. Now it works perfectly,

1 Like