zoukankan      html  css  js  c++  java
  • springboot启动时候的一个注意事项——不同包下有同样名字的class类

    springboot 在启动时候,常启动不起来,检查发现是不同包下面有同名的service和serviceImpl,按理说不同包下是可以有同名的类存在的,但是启动就是启动不了,报错说

     org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'roleServiceImpl' for bean class [com.example.service.RoleServiceImpl] conflicts with existing, non-compatible bean definition of same name and class [com.example.roleService.RoleServiceImpl]

    意思是:以Bean名字‘roleServiceImpl’注解的类[com.example.service.RoleServiceImpl]与存在的不相容的同名类[com.example.roleService.RoleServiceImpl]相冲突。

    原来是在这两个实现类上面都只用了@service这个注解,根据映射规则,这两个service都映射为了roleServiceImpl,发生了冲突。

    解决办法,一:将其中一个实现类改为不同的名字;

                    二:将其中一个注解变更为一个name为非roleServiceImpl的注解@service(name="aaaa")。

    再次启动,OK。


  • 相关阅读:
    Bluetooth GATT介绍
    Bluetooth ATT介绍
    Bluetooth GAP介绍
    Bluetooth Low Energy介绍
    CC2540介绍
    DBus介绍
    802.11 MAC层
    802.11介绍
    Python资料
    Bluedroid之GKI
  • 原文地址:https://www.cnblogs.com/xiaoyao-001/p/9184802.html
Copyright © 2011-2022 走看看