error:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mainController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.euphe.repository.UserRepository com.euphe.controller.MainController.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Using named parameters for method public abstract void com.euphe.repository.UserRepository.updateUser(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer) but parameter 'qPassword' not found in annotated query ' update UserEntity us set us.nickname = :qNickname, us.firstName=:qFirstName, us.lastName =:qLastName, us.password =: qPassword where us.id =:qId'!

 
问题:这个函数没办法识别qPassword
解决:原函数是这样的:
@Query(" update UserEntity us set us.nickname = :qNickname, us.firstName=:qFirstName, " +
"us.lastName =:qLastName, us.password =: qPassword where us.id =:qId")
看出问题来了吗?qPassword和别的的不同就是和:之间多了一个空格,所以没有被识别出来,自然不能Autowired了
 
修改之后:

@Query(" update UserEntity us set us.nickname = :qNickname, us.firstName=:qFirstName, " +
"us.lastName =:qLastName, us.password =:qPassword where us.id =:qId")

Injection of autowired dependencies failed的更多相关文章

  1. eclipse 启动tomcat报Spring错误 Error creating bean with name 'serviceOrderBiz': Injection of autowired dependencies failed

    启动tomcat报异常,提示Sring无法创建serviceOrderBiz(第一行红字),继续看是因为有一个自动注入的字段无法注入ModuleInterfaceBiz(第二行红字),检查servic ...

  2. Error creating bean with name 'signController': Injection of autowired dependencies failed

    出现了一大串错误,Error creating bean with name 'signController': Injection of autowired dependencies failed. ...

  3. 异常:Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException

    这个异常是出现在注入配置文件中配置好的属性时报错的: Injection of autowired dependencies failed; nested exception is java.lang ...

  4. Failed to load ApplicationContext ,Error creating bean with name 'adminUserService': Injection of autowired dependencies failed;

    Druid配置的时候出现这个问题: "C:\Program Files\Java\jdk1.8.0_191\bin\java" -ea -Didea.test.cyclic.buf ...

  5. 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 ...

  6. tomcat启动报错:Injection of autowired dependencies failed

    tomcat启动报错:Injectjion of autowired dependencies failed 环境: 操作系统:centos6.5 tomcat: 7.0.52 jdk:openjdk ...

  7. Error creating bean with name 'adminUserController': Injection of autowired dependencies failed;

    spring 个坑爹地,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ...

  8. tomcat启动报错:Injection of autowired dependencies failed

    Error creating bean with name 'backPrintPaperController': Injection of autowired dependencies failed ...

  9. 使用Mybatis整合spring时报错Injection of autowired dependencies failed;

    这是无法自动注入,通过查找,我出错的原因在于配置文件的路径没有写对,在applicationContext.xml中是这样写的. <bean id="sqlSessionFactory ...

随机推荐

  1. centos7下安装vsftpd

    安装步骤: 创建ftp目录 cd / mkdir ftpfile 创建指定登陆用户并不让他拥有登陆系统的权限(设置指定登陆shell) useradd ftpuser -d /ftpfile/ -s ...

  2. 【Unity3D技术文档翻译】第1.4篇 AssetBundle 依赖关系

    上一章:[Unity3D技术文档翻译]第1.3篇 创建 AssetBundles 本章原文所在章节:[Unity Manual]→[Working in Unity]→[Advanced Develo ...

  3. Selenium常用API用法示例集----下拉框、文本域及富文本框、弹窗、JS、frame、文件上传和下载

    元素识别方法.一组元素定位.鼠标操作.多窗口处理.下拉框.文本域及富文本框.弹窗.JS.frame.文件上传和下载 元素识别方法: driver.find_element_by_id() driver ...

  4. TP5整合 WorkerMan 以及 GatewayWorker

    TP5整合GatewayWorker Windows版安装 a)使用composer create-project topthink/think testTG,来安装thinkphp5. b)进入t ...

  5. PHP封装的一个单例模式Mysql操作类

    掌握满足单例模式的必要条件----三私一公. ①私有的构造方法-为了防止在类外使用new关键字实例化对象. ②私有的成员属性-为了防止在类外引入这个存放对象的属性. ③私有的克隆方法-为了防止在类外通 ...

  6. Opencv 3.3.0 常用函数

    如何调图像的亮度和对比度? //如何增加图片的对比度或亮度? void contrastOrBrightAdjust(InputArray &src,OutputArray &dst, ...

  7. 最长周长三角形 O(nlogn)

    题意   有根棍子,棍子的长度为.想要从中选出三根棍子组成周长尽可能长的三角形.请输出最大的周长,若无法组成三角形输出0. 思路   很容易想到采用三重循环来枚举所有三角形,复杂度为.   更好的办法 ...

  8. OSQA的配置

    1.安装Python,我安装的是python 2.7.3 2.安装setuptools 下载setuptools,并安装 安装好以后,在pyton2.7/scripts的路径下将会有easy_inst ...

  9. 1000多个项目中的十大JavaScript错误以及如何避免

    通过统计数据库中的1000多个项目,我们发现在 JavaScript 中最常出现的错误有10个.下面会向大家介绍这些错误发生的原因以及如何防止. 对于这些错误发生的次数,我们是通过收集的数据统计得出的 ...

  10. android自定义View的绘制原理

    每天我们都会使用很多的应用程序,尽管他们有不同的约定,但大多数应用的设计是非常相似的.这就是为什么许多客户要求使用一些其他应用程序没有的设计,使得应用程序显得独特和不同. 如果功能布局要求非常定制化, ...