![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
_jayjune
The harder you work, the luckier you will be
展开
-
com.sun.proxy.$Proxy4 cannot be cast to spring.HelloService
用spring获取bean的时候遇到代理对象不能转化为本类对象的问题HelloService hello = (HelloService) application.getBean("helloService");这个是 HelloService 实现 IhelloService接口public class HelloService implements IhelloService{ @Ove原创 2016-11-01 22:15:01 · 1804 阅读 · 0 评论 -
failed to read candidate component class
大多数原因都是因为spring3.x不被jdk1.8支持,所以解决办法就是改变工程的jdk版本在eclipse选择到要改变jdk版本web工程,右键–>properties–>Project Facets–>java 改为1.7原创 2017-02-25 22:33:39 · 771 阅读 · 0 评论 -
spring @Autowired与@Resource 的区别
1、@Autowired与@Resource都可以用来装配bean. 都可以写在字段上,或写在setter方法上。 2、@Autowired默认按类型装配(这个注解是属业spring的),默认情况下必须要求依赖对象必须存在,如果要允许null 值,可以设置它的required属性为false,如:@Autowired(required=false) ,如果我们想使用名称装配可以结合@Qualifie转载 2017-02-26 16:05:31 · 339 阅读 · 0 评论