[jboss-user] [EJB 3.0] - Re: Why cant JBoss 4.0.4 GA deploy these Beans?
jnorris10
do-not-reply at jboss.com
Wed Sep 26 18:44:05 EDT 2007
"bill.burke at jboss.com" wrote : You can break the circular dependency by adding the @IgnoreDependency annotation to the injected @EJB
|
|
| | @Stateless
| | public class MyBean implements ... {
| |
| | @EJB
| | @IgnoreDependency
| | private AnotherEJB another;
| |
| | }
| |
| |
|
| Or use the XML version.
|
|
| | <jboss>
| | <enterprise-beans>
| | <session>
| | <ejb-name>Session1Bean</ejb-name>
| | <ejb-ref>
| | <ejb-ref-name>session2</ejb-ref-name>
| | <ignore-dependency/>
| | </ejb-ref>
| | </session>
| | </enterprise-beans>
| | </jboss>
| |
| |
|
The EJB3 spec doesn't seem to have anything to say about this. I have a few circular dependencies in my code (for which the JBoss solution of @IgnoreDependency works really well) but I am wondering should they be refactored out, or is circular injection a conceptually valid thing to do?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089093#4089093
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089093
More information about the jboss-user
mailing list