micronaut-projects / micronaut-spring

A collection of utilities for Spring users of Micronaut
Apache License 2.0
161 stars 46 forks source link

Micronaut in Spring gives the Error #598

Open firdouserp opened 2 weeks ago

firdouserp commented 2 weeks ago

Expected Behavior

I have included the micronaut-spring in my spring-boot application. I also included the MicronautApplicationContext as parent into SpringApplicationContext. However, on Start of SpringApplication i get the following error: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'transactionInterceptor' defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class]: @Bean definition illegally overridden by existing bean definition: Generic bean: class [io.micronaut.spring.tx.annotation.TransactionInterceptor]; scope=singleton; abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null

Actual Behaviour

getting the erro

org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'transactionInterceptor' defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class]: @Bean definition illegally overridden by existing bean definition: Generic bean: class [io.micronaut.spring.tx.annotation.TransactionInterceptor]; scope=singleton; abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null

Steps To Reproduce

spring-boot-micronaut-data-gradle-java.zip

Get a sping boot application from spring initializer. Spring boot 3.2.7 include the micronaut-spring 5.6.0

Environment Information

jdk 17

Example Application

No response

Version

5.6.0

firdouserp commented 2 weeks ago

Here is the project to reproduce the errror spring-boot-micronaut-data-gradle-java.zip

Article i followed : https://guides.micronaut.io/latest/spring-boot-micronaut-data-gradle-java.html