首页 > 移动平台 > 详细

【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration.

时间:2018-02-24 23:37:31      阅读:9258      评论:0      收藏:0      [点我收藏+]

启动报错:

2018-02-24 22:41:00.442  WARN 2952 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController‘: Unsatisfied dependency expressed through field ‘userService‘; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through field ‘userMapper‘; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.newhope.interview.dao.UserMapper‘ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2018-02-24 22:41:00.444  INFO 2952 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-02-24 22:41:00.465  INFO 2952 --- [           main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug‘ enabled.
2018-02-24 22:41:00.564 ERROR 2952 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Field userMapper in com.newhope.interview.service.impl.UserServiceImpl required a bean of type ‘com.newhope.interview.dao.UserMapper‘ that could not be found.


Action:

Consider defining a bean of type ‘com.newhope.interview.dao.UserMapper‘ in your configuration.

 

 

解决方案:

https://www.cnblogs.com/JealousGirl/p/bean.html

 

====================================

未完结

【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration.

原文:https://www.cnblogs.com/sxdcgaq8080/p/8467965.html

(4)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!