autowire异常
来源:互联网 发布:windows查看snmp版本 编辑:程序博客网 时间:2024/06/05 23:58
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.yinlian.wssc.web.service.impl.SupplierSkuServiceImpl com.yinlian.wssc.web.service.impl.OrderServiceImpl.sskuService; nested exception is java.lang.IllegalArgumentException: Can not set com.yinlian.wssc.web.service.impl.SupplierSkuServiceImpl field com.yinlian.wssc.web.service.impl.OrderServiceImpl.sskuService to com.sun.proxy.$Proxy157
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)
... 22 more
Caused by: java.lang.IllegalArgumentException: Can not set com.yinlian.wssc.web.service.impl.SupplierSkuServiceImpl field com.yinlian.wssc.web.service.impl.OrderServiceImpl.sskuService to com.sun.proxy.$Proxy157
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:764)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:569)
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)
... 22 more
Caused by: java.lang.IllegalArgumentException: Can not set com.yinlian.wssc.web.service.impl.SupplierSkuServiceImpl field com.yinlian.wssc.web.service.impl.OrderServiceImpl.sskuService to com.sun.proxy.$Proxy157
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:764)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:569)
... 24 more
今天遇到autowire异常 查了网上说的几种情况
autowire异常主要情况发生的
像上面的情况是自动写入的时候把接口写成实现类了
@Autowired
private SupplierSkuServiceImpl SupplierSkuService;
应该是
@Autowired
privateSupplierSkuService SupplierSkuService ;
以下是从其他地方看到的
还有别的情况可能是:
1。你的BrandServiceImpl必须以@Service或@Component注解才行。
2。自动写入的时候把接口写成实现类了
@Autowired
private BrandServiceImpl brandServiceImpl;
应该是
@Autowired
private BrandService brandService ;
3.在BrandDao 类上加上@Repository注解
0 0
- autowire异常
- MyBatis--autowire异常情况
- autowire异常的三个情况
- autowire异常的三个情况
- autowire异常的三个情况
- autowire异常的三个情况
- autowire
- @autowire
- spring autowire异常的情况分析
- [SpringMVC] Could not autowire field 异常的一种可能原因
- [Spring] Could not autowire field 异常的一种可能原因
- Spring---->autoWire
- Spring中default-autowire与autowire区别
- autowire="byName" /"byType"
- Spring Autowire自动装配
- Spring中autowire属性
- Spring Autowire自动装配
- Spring Autowire自动装配
- 天猫总架构师何崚:好的技术团队不是“需求翻译机”或“架构优化机”
- Java获取计算机的IP、名称、操作系统等信息
- C++根据加密头信息,判断文件是否为加密文件
- bzoj1399 WIN
- VMware Ubuntu安装详细过程(下)
- autowire异常
- 自定义控件
- UIImageView的使用
- 学习笔记_常用第三方模块-PIL
- web开发 学什么?
- svn、git的坑要小心
- 用Spring Boot & Cloud,Angular2快速搭建微服务web应用 - 增加权限控制
- UIButton的使用
- CSS案例,DIV固定在页面底部,不随滚动条的滚动。