Sping Cloud项目启动报A component required a bean of type 'com.tianyan.bbc.dao.SecurityUserBaseMapper&

Posted tianyan87

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sping Cloud项目启动报A component required a bean of type 'com.tianyan.bbc.dao.SecurityUserBaseMapper&相关的知识,希望对你有一定的参考价值。

项目构建正常,启动和Debug报以下错误:

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug‘ enabled.
2018-12-14 09:49:32.038 [main] ERROR o.s.b.diagnostics.LoggingFailureAnalysisReporter -

***************************
APPLICATION FAILED TO START
***************************

Description:

A component required a bean of type ‘com.tianyan.bbc.dao.SecurityUserBaseMapper‘ that could not be found.


Action:

Consider defining a bean of type ‘com.tianyan.bbc.dao.SecurityUserBaseMapper‘ in your configuration.

Disconnected from the target VM, address: ‘127.0.0.1:56886‘, transport: ‘socket‘

Process finished with exit code 1

 

解决办法:

启动类上加上

@MapperScan({ "com.tianyan.bbc.dao"})




以上是关于Sping Cloud项目启动报A component required a bean of type 'com.tianyan.bbc.dao.SecurityUserBaseMapper&的主要内容,如果未能解决你的问题,请参考以下文章

Tomcat启动报错 Failed to start component [StandardServer[8005]]解决

6Sping Cloud Feign

javaweb项目启动报错org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catal

javaweb项目启动报错org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catal

Maven项目启动报错:Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContex

项目启动报错怎么办?看看你Spring自动注入用对了嘛?@Autowired XxxService注入问题解决