Details
-
Bug
-
Resolution: Obsolete
-
Minor
-
JBossAS-5.1.0.GA
-
None
-
None
Description
I got bean based on superclass with shared logic and some circular dependencies
Unfortunately "ignore-dependency" injection from jboss.xml seems to work only if attributes are declared in current class not in superclass'es - I can't use annotations because ear is praparet for weblogic too.
Error example : org.jboss.deployers.spi.DeploymentException: Error deploying test.jar: Unable to create annotation for method/field defBean for EJB AlgBean
Deployment "vfszip:test.ear/" is in error due to the following reason(s): java.lang.NoSuchFieldException: defBean
for case :
<?xml version="1.0" encoding="UTF-8" ?>
<jboss xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
version="3.0">
<enterprise-beans>
<session>
<ejb-name>AlgBean</ejb-name>
<ignore-dependency>
<injection-target>
<injection-target-class>test.DefLocal</injection-target-class>
<injection-target-name>defBean</injection-target-name>
</injection-target>
</ignore-dependency>
</session>
</enterprise-beans>
</jboss>
@Stateless(name = "AlgBean", mappedName = "ejb.DefAlg")
public class AlgBean extends AlgBeanImpl implements DefAlgLocal,DefAlgRemote {
}
public class AlgBeanImpl implements DefAlg {
@EJB
protected DefLocal defBean;
}
There are no problems is DefLocal defBean is moved from superclass to AlgBean.