Java报错:Injection of resource dependencies failed
在学习springMVC+Mabatis的时候,添加注解@Resource报错
Injection of resource dependencies failed
de完bug后发现有几个点注意一下,基本上的问题都是spring没有扫描到mappre接口
调试一下以下几个地方:
1.applicationContext.xml
<!-- 启用Spring注解形式扫描对象 -->
<context:component-scan base-package="com.sirifeng"/>
这里注意下包名(base-package)!!!
2.XXX_mapeer.xml文件中检查 namespace 是否正确
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--namespace指向接口-->
<mapper namespace="com.sirifeng.chapter5.mapper.BooksMapper">
<!--
id与方法名保持一致
parameterType与参数类型保持一致
resultType与方法返回值保持一致
-->
<select id="findById" parameterType="String" resultType="com.sirifeng.chapter5.entity.Book">
select * from books where isbn = #{value}
</select> </mapper>
Java报错:Injection of resource dependencies failed的更多相关文章
- tomcat启动报错:Injection of autowired dependencies failed
Error creating bean with name 'backPrintPaperController': Injection of autowired dependencies failed ...
- Java报错:Error creating bean with name 'testController': Injection of resource dependencies failed
报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testCo ...
- 【解决方案】 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHandler': Injection of resource dependencies failed;
一个错误会浪费好多青春绳命 鉴于此,为了不让大家也走弯路,分享解决方案. [错误代码提示] StandardWrapper.Throwableorg.springframework.beans.fac ...
- Injection of resource dependencies failed解决办法总结
今天调试项目代码,出现的引resource的报错,查原因查了好长时间才找到,现在这里总结一下,以免以后忘掉以及给大家参考. 报错大致内容入下: org.springframework.beans.fa ...
- Error creating bean with name 'testController': Injection of resource dependencies failed;
启动ssm项目报错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 't ...
- 使用Mybatis整合spring时报错Injection of autowired dependencies failed;
这是无法自动注入,通过查找,我出错的原因在于配置文件的路径没有写对,在applicationContext.xml中是这样写的. <bean id="sqlSessionFactory ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'supplierAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factor
这个错误是因为抽象Action类的时候,把ServletContext写成了serverContext,导致无法注入,正确写法是 import javax.annotation.Resource; i ...
- Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fundService': Injection of resource dependencies failed;
在进行SSM的Controller的编写, 从浏览器访问后端Controller的时候遇到了这个问题. 这个问题的描述: 创建Bean的对象失败 错误代码如下: @Service("fund ...
- IDEA报错: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"
运行审核流模块: 在ActivitiServiceApplication模块日志报错: Error starting ApplicationContext. To display the auto-c ...
随机推荐
- 如何用Google Drive下载超大型文件
本文将对「如何下载Google Drive中的超大型文件?」这一问题展开探索和解决. 太长不读:直接看这里 情景与问题 在AI.系统安全等研究领域,一项研究成果的产生需要大量的数据样本进行训练和分析, ...
- Eureka 基本教程
目录 Eureka 基本教程 RestTemplate 使用 Eureka 使用 注册中心 提供者 消费者 Eureka 基本教程 RestTemplate 使用 学习Euraka的同学直接滑到最下面 ...
- Mybatis工具类(自动提交事务)
public class MybatisUtils { private static SqlSessionFactory sqlSessionFactory; static { try { //获取工 ...
- Java案例——反转字符串
/*案例:将用户输入的字符串反转并输出 分析:1.使用Scanner 类获取用户输入的字符串 2.定义一个方法将字符串反着遍历并拼接 3.定义变量接受并输出* */public class Strin ...
- ubuntu21.10搭建jenkins和gitlab自动化部署环境
镜像下载.域名解析.时间同步请点击阿里云开源镜像站 前置环境: vmware pro 16 + ubuntu21.10 安装gitlab 搭建ssh远程 打开终端 sudo apt-get insta ...
- linux下查看文件编码及修改编码介绍
1.在Vim中可以直接查看文件编码:set fileencoding即可显示文件编码格式.如果你只是想查看其它编码格式的文件或者想解决用Vim查看文件乱码的问题,那么你可以在~/.vimrc 文件中添 ...
- Linux系统常用指令
建立一个文件或文件夹的软链接: ln -s 原名 软链接名 软链接就类似Windows下的"快捷方式",访问它其实访问的是它指向的内容. git仓库操作 1.通常远程操作的第一步, ...
- 4月11日 python学习总结 对象与类
1.类的定义 #类的定义 class 类名: 属性='xxx' def __init__(self): self.name='enon' self.age=18 def other_func: pas ...
- 说一下linux启动过程boot流程
linux启动过程 https://www.ibm.com/developerworks/cn/linux/l-linuxboot/index.html http://www.ruanyifeng.c ...
- v-if 与 v-for 同时使用会报错
在进行项目开发的时候因为在一个标签上同时使用了v-for和v-if两个指令导致的报错. 报错代码如下: <el-input type="textarea" :autosize ...