プロジェクトでSpring3を使用していますが、JARファイルからSpringBeanを注入すると問題が発生します。JARファイルには、次のようなクラスがあります。
package test;
@Service("CommonService")
public class CommonService {
}
そして、私はすでにそれをこのように使用しました。
package com.java.test.app;
@Service(value = "OtherService")
public class OtherService {
@Resource(name = "CommonService")
private CommonService service;
}
私の春-beans.xml;
<context:component-scan base-package="com.java.test.app, test">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
</context:component-scan>
しかし、@Resource
アノテーションは機能しません。JARファイルからSpring Beanを注入できますか?