Could not autowire field

本文解决了一个关于Spring框架中使用Spring Data JPA时出现的自动装配错误问题,涉及RoleServiceImpl类中MenuRepository字段无法正确注入的情况。异常信息提示没有找到Menu类型对应的user属性。
摘要由CSDN通过智能技术生成
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.itcast.bos.dao.system.MenuRespositort cn.itcast.bos.service.system.impl.RoleServiceImpl.menuRespository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'menuRespositort': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property user found for type Menu!
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
	... 77 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'menuRespositort': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property user found for type Menu!

解决问题

导入jar包出错

import org.springframework.data.elasticsearch.annotations.Query;

import org.springframework.data.jpa.repository.Query;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值