Markus Lutum [
http://community.jboss.org/people/mclu] created the discussion
"@EJB and Class Hierarchy"
To view the discussion, visit:
http://community.jboss.org/message/600013#600013
--------------------------------------------------------------
Hi!
Currently I am migrating an application from AS 4.2.3 to AS 6.0.0
In the old system we have a hirarchy like:
@Stateless(name = "CarrierUC")
public class CarrierUCBean extends AbstractUC implements CarrierUC {
....
}
and a subclass like
@Stateless(name = "PersonUC")
public class PersonUCBean extends CarrierUCBean implements PersonUC {
....
}
Other Session Beans inject them using
@EJB CarrierUC m_carrierUC;
or
@EJB PersonUC m_personUC;
Now with Jboss 6 the system could not deploy my beans because he mention that the injected
CarrierUC is not unique and I should use beanName.
Message:
Caused by: java.lang.RuntimeException: Specified reference [EJB Reference: beanInterface
'com.XXX.CarrierUC', beanName 'null', mappedName 'null',
lookupName 'null', owning unit
'ComponentDeploymentContext(a)17671586{org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.MyClientService}']
was matched by more than one EJB:
[org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData@1e4488c3{PersonUC},
org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData@81412b66{CarrierUC},
org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData(a)12e9e9a{VehicleUC}]. Specify
beanName explicitly or ensure beanInterface is unique.
OK, when I use
@EJB(beanName="CarrierUC") CarrierUC m_carrierUC;
it works.
Do I really have to change ALL my injection lines where I have session bean class
hierarchies or is there a way to configure the old behaviour?
Thx from Germany
Markus
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/600013#600013]
Start a new discussion in EJB3 at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]