[jboss-user] [EJB 3.0] - Re: handling ejb3 injection failure

ALRubinger do-not-reply at jboss.com
Thu Sep 6 11:56:17 EDT 2007


The @EJB Annotation does more than injection; it also establishes a dependency.

For a JBoss-specific solution, you can also annotate your instance variable with @IgnoreDependency like:

@EJB
  | @IgnoreDependency
  | MyBeanClass myBean;

...which I believe should work, though I've never tried this use case specifically.  One thing it won't do is inject "myBean" if "MyBeanClass" is deployed *after* your other service - the container won't keep track of what injections it should perform if they're deployed at a later time.

Also, your lookups don't necessarily have to point to a JNDI address that includes the application name.  JBoss assigns these by default, but you can override with ejb-jar.xml or the @RemoteBinding/@LocalBinding annotations.

S,
ALR

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081732#4081732

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081732



More information about the jboss-user mailing list