Circular dependency bug at Jboss5.1.1 AS

Hi,  
I have been struggeling this for a week now. This is a seriouse bug at Jboss5.1 and EJB3.

Example for Circular dependence:

In CompanyCoreBean

  @EJB(name = "CompanyCoreBean")
  private CompanyCoreBeanLocal companyCoreBean;

CompanyCoreBean is injected to itself

leading to this jboss error:

DEPLOYMENTS MISSING DEPENDENCIES:
Deployment

“jboss.j2ee:ear=WMA_EXPLODED.ear,jar=

WMA_EXPLODEDEJB.jar,name=CompanyCoreBean,service=EJB3” is missing the following dependencies:
Dependency “<UNKNOWN jboss.j2ee:ear=WMA_EXPLODED.ear,jar=

WMA_EXPLODEDEJB.jar,name=CompanyCoreBean,service=EJB3>”

(should be in state “Installed”, but is actually in state “** UNRESOLVED Demands ‘jndi:WMA_EXPLODED/CompanyCoreBean/local-com.mirs.wma.core.sessionBeans.CompanyCoreBeanLocal’ **”)

Dependency “<UNKNOWN

 

There is an open Jira about the issue. but I had to overcome this one.

So the walk around is using the Annotation @IgnoreDependency. which will Ignore it’s own dependency on deployment.

@IgnoreDependency
@EJB(name = "CompanyCoreBean")
private CompanyCoreBeanLocal companyCoreBean;

Idan.

[ad]

Related Articles:

(1183)

Be Sociable, Share!

Leave a Reply