解决 "Could not autowire. No beans of 'SationMapper' type found" 的问题
网上查找的方法,附上原文链接:https://blog.csdn.net/Coder_Knight/article/details/83999139
方法1:在mapper文件上加@Repository注解,这是从spring2.0新增的一个注解,用于简化 Spring 的开发,实现数据访问
方法2:在mapper文件上加@Component注解,把普通pojo实例化到spring容器中,相当于配置文件中的<bean id="" class=""/>
加上这两个就不报错了。
1、@Service用于标注业务层组件
2、@Controller用于标注控制层组件(如struts中的action)
3、@Repository用于标注数据访问组件,即DAO组件.
4、@Component泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注。
解决 "Could not autowire. No beans of 'SationMapper' type found" 的问题的更多相关文章
- IntelliJ Idea 解决 Could not autowire. No beans of 'xxxx' type found 的错误提示
IntelliJ Idea 解决 Could not autowire. No beans of 'xxxx' type found 的错误提示哈,在使用 @Autowired 时,今天又遇一坑,这俩 ...
- IntelliJ Idea解决Could not autowire. No beans of 'xxxx' type found的错误提示
本文转自:http://blog.csdn.net/u012453843/article/details/54906905 1.问题描述 在Idea的spring工程里,经常会遇到Could not ...
- IntelliJ Idea如何解决Could not autowire. No beans of 'xxxx' type found的错误提示
问题描述 在idea中进行开发时,经常会遇见Could not autowire. No beans of 'xxxx' type found的错误提示,这样的是不影响程序编译和运行的,但是看起来会很 ...
- Could not autowire. No beans of 'TbItemMapper' type found. less... (Ctrl+F1) Checks autowiring prob
Intellij Idea开发工具在@Autowired或者@Resource注入XxxMapper接口时报如下错误: Could not autowire. No beans of 'TbItemM ...
- Could not autowire. No beans of 'TbAssetsMapper' type found. less... (Ctrl+F1) Inspection info:Checks autowiring problems in a bean class.
报错:Could not autowire. No beans of 'TbAssetsMapper' type found. less... (Ctrl+F1) Inspection info:Ch ...
- SpringBoot注入Mapper提示Could not autowire. No beans of 'xxxMapper' type found错误
通过用Mabatis的逆向工程生成的Entity和Mapper.在Service层注入的时候一直提示Could not autowire. No beans of 'xxxMapper' type f ...
- IDEACould not autowire. No beans of 'xxxMapper' type found.
作为一名刚开始使用idea的新手,最近在使用maven+springMVC框架时遇到了这样一个问题:Could not autowire. No beans of 'xxxMapper' type f ...
- Could not autowire. No beans of 'int' type found. less... (Ctrl+F1) Checks autowiring problems in a bean class.
package com.cxy.netty.controller; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel ...
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
1.问题描述 在Idea的spring工程里,经常会遇到Could not autowire. No beans of 'xxxx' type found的错误提示.但程序的编译和运行都是没有问题的, ...
随机推荐
- dubbo源码阅读笔记-如何引用远程服务,变成invoker
1 消费端如何通过注册中心获取远程服务的invoker? RegistryDirectory.subscribe从注册中心中获取provider的url,通过DubboProtocol的refer方法 ...
- Java程序设计第十周学习总结
Java课程知识梳理: 流的区分; 字符流与字节流的区别: 字节流是直接操作文件本身的,如果没有关闭字节流操作,文件会依然输出内容 而字符流在程序运行之后会发现文件没有任何的内容,这是因为字符流操作的 ...
- webSocket通信
针对webSocket通信总结: 1.webSocket通信原理图: 2.webSocket通信实例 参考地址1:https://www.cnblogs.com/cjm123/p/9674506.ht ...
- leetcode227 基本计算器
1先利用符号栈转化为逆波兰表达式,并添加‘,’作为一个数字的结尾: 2然后利用数字栈计算逆波兰表达式的值: class Solution { public: int calculate(string ...
- 创建一个包含TC的Alpine镜像
镜像的创建 更换镜像至ustc(为了测试时的速度) 安装musl-dev make gcc linux-headers bison flex以使TC可以编译 拷贝进TC的源代码 进入源代码文件夹进行编 ...
- nodejs之express中间件body-parser使用
1.安装express和body-parser npm install express npm install body-parser 2‘.案例如下 var express = require('e ...
- global和nonlocal的用法
1 nonlocal声明的变量不是局部变量,也不是全局变量,而是外部嵌套函数内的变量.写在内部嵌套函数里面,它实质上是将该变量定义成了全局变量,它等价于用两个global来定义该变量.只不过用两个gl ...
- Linux下监控网卡流量的软件Nload
Linux下监控网卡流量的软件Nload 安装nload: # wget http://www.roland-riegel.de/nload/nload-0.7.2.tar.gz # tar zxvf ...
- 部署php程序报错解决---TP框架
1.TP框架中 出现如下错误: 访问网站 http://192.168.0.204/ STORAGE_WRITE_ERROR_:./Runtime/Cache/Home/51620d75af91aa7 ...
- Cmake + VS2013编译opencv
下载之后,使用cmake转为vs解决方案的时候,配置OPENCV_EXTRA_MODULES_PATH=<path to opencv_contrib/modules/>,然后才能使用ex ...