首页 > 编程知识 正文

spring boot注解详解,error statuslogger no log4j2

时间:2023-05-03 09:25:33 阅读:28414 作者:2831

今天敲代码,使用mybaits,向启动类中添加@MapperScan发现服务无法启动。

具体错误如下。 org.spring framework.context.annotation.conflictingbeandefinitionexception : annotation-specified beanname ' wean name rvice]conflictswithexisting, non-compatiblebeandefinitionofsamenameandclass [ com.riant.my batis.service.impl.websiteserviceimpl ] atorg.spring framework.context.annotation.classpathbeandefinitionscanner.check candidate (~[ spring-context-5.] atorg.my batis.spring.mapper.classpathmapperscanner.check candidate (classpathmapperscanner.Java 3360256 ) ) my bate . classpathbeandefinitionscanner.doscan (~[ spring-context-5.1.2.release.jar :5.1.2.release ] atorg.my batis.spring.mapper.classpathmapperrg~[ my batis-spring-2.0.4.jar :2.0.4 ] atorg.spring framework.context.annotation.classpathbeandefinitionscanner.scan (classpathbeandefinitionscaner.Java 605.1.2.Release] atorg.my batis.spring.mapper.mapperscannerconfigurer.postprocessbeandefinitionregistry (mapperscanerconfigurer.japorer pring-2.0.4.jar:2.0.4] atorg.spring framework.context.support.postprocessorregistrationdelegate.invokebeandefinitionregistrypostrocessors () elease.jar:5.1.2.Release] atorg.spring framework.context.support.postprocessorregistrationdelegate.invokebeanfactorypostprocessors ((spring atorg.spring framework.context.support.abstractapplicationcontext.invokebeanfactorypostprocessors (~[ spring-cont-cont ) ] atorg.spring framework.context.support.abstractapplicationcontext.refresh (abstractapplicationcontext.Java 3360526 605.1.2.Release] atorg.spring framework.boot.web.servlet.context.servletwebserverapplicationcontext.refresh (~[ spring-boot-bot-] atorg.spring framework.boot.spring application.release [ spring-boot-2.1.0.release.jar :2.1.0 ] atorg.spring framework.boot.spring application.re fork [ spring-boot-2.1.0.release.jar :2.1.0.release atorg.spring framework.boot.spring application.run [ spring-boot-2.1.0.release.jar :2.1.0.release ] atorg.spring framework.boot.spring application.run [ spring-boot-2.1.0.release.jar :2.1.0.release ] atorg.spring framework.boot.spring application.run [ spring-boot-2.1.0.release.jar :2.1.0.release ] atcom.riant.my batis.mybatisapplication.main (原因:在启动类中使用@MapperScan扫描整个包时,@MapperScan将显示在包下的所有接口结果,我的service层接口com.riant.my batis.service.websiteservice和service.impl下的接口是com.riant.my batis .类

@SpringBootApplication//表示要扫描的Mapper的目录路径位于com.riant.mybatis.dao下。 //@ mappers can (com.riant.my batis ) mappers can (com.riant.my batis.Dao ) ) publicclassmybatisapplication }解决方案: DD

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。