JBoss Community

Could not resolve @EJB reference: [EJB Reference: beanInterface...

created by Maksym RMA in JBoss Microcontainer - View the full discussion

Hello All

 

I have problem with Stateless EJB3 dependency injection on JBoss 6.1 with ESB 4.10

 

.

More details:

I have 2 ear files. EJB and local interface in one of them, and I am trying to call this EJB in other one ear.

 

EJB (First ear):

 

@Stateless

@Local (ProductCreditTypeDAOLocal.class)

public class ProductCreditTypeDAOBean extends BasicDAO<ProductCreditTypeEntity, Long> implements ProductCreditTypeDAOLocal#####

.....



Interface (First ear):

 

public interface ProductCreditTypeDAOLocal ....

 

Call (Second ear):

@Stateless
@Remote(EcsAdminDataDispatcher.class)
public class EcsAdminDataDispatcherBean extends EcspertEJBBase implements EcsAdminDataDispatcher {

@Resource
private SessionContext sessionContext;

@EJB
private ProductCreditTypeDAOLocal productCreditTypeDAO; --- This is problem injection!

 

I tryed enable EAR class loading isolation (jboss-app.xml):

<!DOCTYPE jboss-app PUBLIC

    "-//JBoss//DTD J2EE Application 5.0//EN"

    "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd">

<jboss-app>

<loader-repository>myapp:app=ejb3</loader-repository> -- How I understood, this one tell jboss server to load classes in isolated repository.

</jboss-app>

 

 

I tryed change:

@Local (ProductCreditTypeDAOLocal.class)

to @Remote but result is same (see next...).

 

 

 

 

 

On deploy phase next exception occurs:

 

Error installing to Real: name=vfs:///D:/tmp/jboss-6.1.0.Final/server/efour_conf/deploy/credit/creditBL.ear state=PreReal mode=Manual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error during deploy: org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.EcsAdminDataDispatcherBean

at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.2.GA]

....

Caused by: java.lang.RuntimeException: Could not resolve @EJB reference: [EJB Reference: beanInterface 'com.cs.creditecspert.dao.local.ProductCreditTypeDAOLocal', beanName 'null', mappedName 'null', lookupName 'null', owning unit 'ComponentDeploymentContext@8065331{org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.EcsAdminDataDispatcherBean}'] for environment entry: env/com.cs.creditecspert.admindispatcher.EcsAdminDataDispatcherBean/productCreditTypeDAO in unit ComponentDeploymentContext@8065331{org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.EcsAdminDataDispatcherBean}

at org.jboss.ejb3.jndi.deployers.resource.provider.AnnotatedEJBRefResourceProvider.provide(AnnotatedEJBRefResourceProvider.java:99) [:0.1.7]

at org.jboss.ejb3.jndi.deployers.resource.provider.AnnotatedEJBRefResourceProvider.provide(AnnotatedEJBRefResourceProvider.java:50) [:0.1.7]

 

As fact it works fine on jboss 4.2.3GA.

 

Have any ideas...?

I will be grateful for any....

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community