解决 "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的错误提示.但程序的编译和运行都是没有问题的, ...
随机推荐
- 一致性Hash 分析和实现
一致性Hash 分析和实现 ---title: 1.一致性Hashdate: 2018-02-05 12:03:22categories:- 一致性Hash--- 一下分析来源于网络总结:算法参照自己 ...
- C++入门经典-例3.19-使用break跳出循环
1:代码如下: // 3.19.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> usin ...
- _parameter:解决There is no getter for property named in class java.lang.String
我们知道在mybatis的映射中传参数,只能传入一个.通过#{参数名} 即可获取传入的值. Mapper接口文件: public int delete(int id) throws Exception ...
- yum源相关
yum软件仓库默认配置文件/etc/yum.conf,此文件定义了yum在线下载的rpm包存放位置及下载后是否保存. [root@localhost ~]# head /etc/yum.conf[ma ...
- NavisWorks连接外部数据库,为模型附加属性
可以直接从Navisworks 文件连接到外部数据库,并在场景中的对象与数据库表中的字段之间创建链接以引入额外特性. 1.连接mdb数据库 新建数据连接 单击“新建”按钮,新建数据连接,输入一个名称, ...
- golang tcp keepalive实践
前文中已经介绍了TCP keep alive的做了详尽说明,本文结合golang,介绍如何使用TCP keep alive. 目前golang net包不提供TCP keep alive 空闲多长时间 ...
- Git - p4merge
Windows 下配置 先确保 p4merge 的路径(默认:C:\Program Files\Perforce\)在环境变量中 C:\Users\zjffu>where p4merge C:\ ...
- mysql的逻辑架构
架构图 做Java开发时,项目一般会分为数据访问层.业务逻辑层.控制层等,每层处理不同的任务.类似的,mysql也不是单一的模块,其内部也分为几层.自己不会画,从网上找来了经典的mysql架构图: 分 ...
- Web02_HTML&CSS
HTML 表单标签属性介绍 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- 使用ssh-agent管理私钥
使用ssh-agent的好处: 如果有多台远程服务器与多个私钥文件,ssh-gent将会尝试使用不同的私钥文件建立连接,直至成功 假如有 A.B.C 三台服务器,A是控制节点,A可以直接登录B,但是无 ...