mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found
2017-08-15 12:43
501 查看
工具及背景: IntelliJ IDEA 2016.1.3 Ultimate。spring boot, maven项目,利用mybatis 注解的方式查询mysql。
业务逻辑关系:controller --> Service接口 ----> serverImpl --->Dao -->DaoImpl ---> mapper -->db
问题:mapper提示Could not autowire. No beans of … type found?如图:
其中ProductDaoMyBatisMapper是个接口,用于查询mysql,结构如下图:
解决办法:将第一张图中的ProductDaoMyBatis类序列化,即实现Serializable 接口即可,如下图:
补:pom.xml
业务逻辑关系:controller --> Service接口 ----> serverImpl --->Dao -->DaoImpl ---> mapper -->db
问题:mapper提示Could not autowire. No beans of … type found?如图:
其中ProductDaoMyBatisMapper是个接口,用于查询mysql,结构如下图:
解决办法:将第一张图中的ProductDaoMyBatis类序列化,即实现Serializable 接口即可,如下图:
补:pom.xml
<!--mybatis--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.1.1</version> </dependency> 方法二: 还有一种方式,修改idea配置,将spring 的severity的值设置为"warning", 如下:
相关文章推荐
- idea中mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found解决办法
- mybatis+spring boot, @Autowired 提示Could not autowire. No beans of … type found
- IDEA下Spring项目报错-could not autowire. no beans of“” type found
- mapper提示Could not autowire. No beans of … type found?
- mapper提示Could not autowire. No beans of … type found?
- Idea的spring工程里,经常会遇到Could not autowire. No beans of 'xxxx' type found的错误提示
- IntelliJ idea在Spring配置无错误时,装配对象出现 Could not autowire. no beans of "XXX" type found
- springboot整合mybatis mapper注入时显示could not autowire的解决
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
- Could not autowire. No beans of 'UserMapper' type found.
- idea 出现Could not autowire. No beans of 'xxxxMapper' type found. 安装 Mybatis Plugin 插件
- 【问题】Could not autowire. No beans of … type found
- Could not autowire. No beans of 'UserMapper' type found.
- IDEA引入dao接口,Could not autowire. No beans of 'UserMapper' type found
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
- Could not autowire. No beans of … type found
- Could not autowire. No beans of 'xxxx' type found的错误提示(IntelliJ Idea)
- Could not autowire. No beans of 'xxxMapper' type found.
- Spring Boot中使用Feign调用时Hystrix提示异常:"could not be queued for execution and no fallback available."以及"Rejected command because thread-pool queueSize is at rejection threshold"
- could not autowire.No beans of 'FunctionService' type found.