我一直在尝试从 JBOSS 5 升级到 jboss 7,但出现以下异常。
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_20]
Caused by: java.lang.IllegalArgumentException: JBAS011089: @Resource injection target is invalid. Only setter methods are allowed: void com.myaccount.admin.manager.dao.ManagerDaoImpl.init(com.ibatis.sqlmap.client.SqlMapClient)
at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.processMethodResource(ResourceInjectionAnnotationParsingProcessor.java:192)
at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.deploy(ResourceInjectionAnnotationParsingProcessor.java:153)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
这是代码
@Repository("managerDao")
public class ManagerDaoImpl extends SqlMapClientDaoSupport implements ManagerDao {
@Resource(name="sqlMapClient_ADMIN")
public void init(SqlMapClient sqlMapClient) {
setSqlMapClient(sqlMapClient);
}
......
我用谷歌搜索,但除了 jboss jar 的源代码外,我什么也没找到。