zoukankan      html  css  js  c++  java
  • 2. springboot启动报错:Field userMapper in com.service.UserService required a bean of type 'com.dao.UserMapper' that could not be found.

    报错信息:

    2018-06-25 14:26:17.103  WARN 49752 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'centerController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.dao.UserMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    2018-06-25 14:26:17.105  INFO 49752 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service Tomcat
    2018-06-25 14:26:17.119  INFO 49752 --- [  restartedMain] utoConfigurationReportLoggingInitializer :

    Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
    2018-06-25 14:26:17.228 ERROR 49752 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   :

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

    Description:

    Field userMapper in com.service.UserService required a bean of type 'com.dao.UserMapper' that could not be found.


    Action:

    Consider defining a bean of type 'com.dao.UserMapper' in your configuration.

    解决方法:

    1.检查接口类有没加上注解@Mapper

  • 相关阅读:
    vue.js 快速入门
    简洁的MVC思想框架——Nancy(Post操作与外部引用css和JS)
    简洁的MVC思想框架——Nancy(环境配置与Get操作)
    iOS开发之注册推送通知权限
    iOS开发之数组排序
    iOS开发之打包上传报错: ERROR ITMS-90087/ERROR ITMS-90125
    iOS开发之HTTP与HTTPS网络请求
    iOS开发之GCD同步主线程、异步主线程
    iOS开发之获取时间戳方法
    iOS开发之将字典、数组转为JSON字符串方法
  • 原文地址:https://www.cnblogs.com/zkx4213/p/9224183.html
Copyright © 2011-2022 走看看