-
1. Re: @EJB injection not working in JBoss 6.x
Daniel Bevenius Aug 30, 2011 10:15 AM (in response to gunter zeilinger)Hi Gunter,
I'm not sure if this is your issue, but when I forget to add a META-INF/beans.xml I get the same behaviour. No error and the injected resource in null as I believe WELD will not pick up the deployment and hence not scanning it for annotations.
Regards,
/Daniel
-
2. Re: @EJB injection not working in JBoss 6.x
Ales Justin Aug 30, 2011 11:09 AM (in response to Daniel Bevenius)I'm not sure if this is your issue, but when I forget to add a META-INF/beans.xml I get the same behaviour. No error and the injected resource in null as I believe WELD will not pick up the deployment and hence not scanning it for annotations.
I think this is a diff issue; Weld != MC. ;-)
-
3. Re: @EJB injection not working in JBoss 6.x
Ales Justin Aug 30, 2011 11:10 AM (in response to gunter zeilinger)1 of 1 people found this helpfulI tried to use @EJB annotation in MC bean in JBoss AS 6.x to inject SLSB, but without success. There is no error log, the annotated field just remains null. Doing the JNDI lookup manually works. Have I activate the EjbReferenceAnnotationPlugin in some way?
Did you follow ALR's instructions on how to do this?
* http://exitcondition.alrubinger.com/2008/12/20/doing-two-models-at-the-same-time/
-
4. Re: @EJB injection not working in JBoss 6.x
gunter zeilinger Aug 31, 2011 3:47 AM (in response to Ales Justin)I thought ALR's solution with
org.jboss.ejb3.mcint.metadata.plugins.EjbReferenceAnnotationPlugin
org.jboss.ejb3.mcint.metadata.plugins.AbstractEjbReferenceValueMetadata
org.jboss.ejb3.mcint.annotationadaptor.AddAnnotationPluginOnBeanAnnotationAdaptorCallbackService
is already included in JBoss 6.x and deployed by jboss-6.1.0.Final/server/default/deployers/ejb3.deployer/META-INF/ejb3-deployers-jboss-beans.xml:
<!-- Add Annotation Plugins upon installation -->
<bean name="org.jboss.ejb3.AddAnnotationPluginOnBeanAnnotationAdaptorCallbackService"
class="org.jboss.ejb3.mcint.annotationadaptor.AddAnnotationPluginOnBeanAnnotationAdaptorCallbackService">
<constructor>
<parameter><inject bean="jboss.kernel:service=Kernel"/></parameter>
</constructor>
</bean>
<!-- TODO: Move this out of core -->
<!-- EJB Reference Annotation Plugin -->
<bean name="org.jboss.ejb3.EjbReferenceAnnotationPlugin"
class="org.jboss.ejb3.mcint.metadata.plugins.EjbReferenceAnnotationPlugin">
<constructor>
<parameter><inject bean="org.jboss.ejb3.EjbReferenceResolver" /></parameter>
</constructor>
</bean>
by default. Isn't it?
-
5. Re: @EJB injection not working in JBoss 6.x
gunter zeilinger Aug 31, 2011 4:38 AM (in response to gunter zeilinger)Oops, I missed your comment at http://exitcondition.alrubinger.com/2008/12/20/doing-two-models-at-the-same-time/ :
Perhaps a missing detail that gave you problems as well is the no-fields by default.
Meaning one must change BeanAccessMode –> FIELDS or ALL.
Adding
<bean .. access-mode="ALL">
and it works as expected. Thanks!