{channel.title!channel.name} - 楚淮公司周东林

SpringBOOT 报Consider defining a bean of type

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


报错信息

2018-11-08 17:51:34.266 ERROR 5220 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field xfjDao in com.jschrj.service.ExtService required a bean of type 'com.jschrj.dao.XfjExtMapper' that could not be found.

Action:
Consider defining a bean of type 'com.jschrj.dao.XfjExtMapper' in your configuration.
 
解决办法:在DAO的接口文件上面加 @Mapper  注解,如果不能加注解是因为下面的依赖错了。

spring 集成 mybatis 的依赖变了

原来是


<dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.2.2</version> </dependency>

spring boot 要换成

        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.0</version>
        </dependency>

 

 

 


浏览.发表于:2018-11-08 17:54:12