how to handle the conflicts between Mybatis-Plus and Xstream

36 Views Asked by At

my project integrate Springcloud Eureka and Mybatis-plus but it can not work!

the exception when i boost the springcloud like this:

org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'mapper' for bean class [com.thoughtworks.xstream.mapper.Mapper] conflicts with existing, non-compatible bean definition of same name and class [com.baomidou.mybatisplus.core.mapper.Mapper]
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:349) ~[spring-context-5.3.18.jar:5.3.18]
    at org.mybatis.spring.mapper.ClassPathMapperScanner.checkCandidate(ClassPathMapperScanner.java:310) ~[mybatis-spring-2.0.6.jar:2.0.6]
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:287) ~[spring-context-5.3.18.jar:5.3.18]
    at org.mybatis.spring.mapper.ClassPathMapperScanner.doScan(ClassPathMapperScanner.java:204) ~[mybatis-spring-2.0.6.jar:2.0.6]
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.scan(ClassPathBeanDefinitionScanner.java:254) ~[spring-context-5.3.18.jar:5.3.18]
    at org.mybatis.spring.mapper.MapperScannerConfigurer.postProcessBeanDefinitionRegistry(MapperScannerConfigurer.java:375) ~[mybatis-spring-2.0.6.jar:2.0.6]
    at io.choerodon.mybatis.spring.CommonMapperScannerConfigurer.postProcessBeanDefinitionRegistry(CommonMapperScannerConfigurer.java:79) ~[hzero-starter-mybatis-mapper-1.9.0.RELEASE.jar:1.9.0.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[spring-context-5.3.18.jar:5.3.18]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:142) ~[spring-context-5.3.18.jar:5.3.18]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.18.jar:5.3.18]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.18.jar:5.3.18]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.12.jar:2.5.12]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.5.12.jar:2.5.12]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:448) [spring-boot-2.5.12.jar:2.5.12]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:339) [spring-boot-2.5.12.jar:2.5.12]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365) [spring-boot-2.5.12.jar:2.5.12]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) [spring-boot-2.5.12.jar:2.5.12]
    at com.anker.ipd.basis.IPDBasisApplication.main(IPDBasisApplication.java:23) [classes/:na]

i try to find out what cause the conflict by mvn dependency:tree

0

There are 0 best solutions below