已解决
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'myCenterController' for bean class [com.tanhua.sso.controller.MyCenterController] conflicts with existing, non-compatible bean definition of same name and class [com.tanhua.server.controller.MyCenterController]
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:348) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:286) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:287) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
... 13 common frames omitted
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException ConflictingBeanDefinitionException:Bean定义冲突异常
Annotation-specified bean name ‘myCenterController’ for bean class [com.tanhua.sso.controller.MyCenterController] conflicts with existing, non-compatible bean definition of same name and class [com.tanhua.server.controller.MyCenterController] 大致意思是: 为bean类指定注解的bean名称’myCenterController’ [com.tanhua.sso.controller.MyCenterController] 关键词与现有的、不兼容的同名类bean定义冲突[com.tanhua.server.controller.MyCenterController]
com.tanhua.sso.controller.MyCenterController里面的注解或者包引用了com.tanhua.server.controller.MyCenterController模块的
查了一遍都没问题
因为我是运行启动的server模块的启动类,所以暂时分析是server模块的pom文件依赖了同级模块sso的pom文件,从而导致出现了这个错误
server模块的pom文件依赖了同级模块sso的pom文件
删除这个server模块的pom依赖
启动成功