1 Reply Latest reply on Jun 10, 2011 3:23 AM by jaikiran pai

    @EJB is not available for Web/EJB

    Dmitri Voronov Novice

      Hi all,

       

      in my POJO managed bean in a WAR I tried to inject an EJB but @EJB was not found:

      root cause

      java.lang.NoClassDefFoundError: javax/ejb/EJB org.jboss.as.weld.services.bootstrap.WeldEjbInjectionServices.resolveEjb(WeldEjbInjectionServices.java:57) org.jboss.weld.util.Beans.injectEEFields(Beans.java:772) org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:181) org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:54)

       

      Is it not provided in JBoss AS 7 Beta3?

       

      I could actually fix it by including the dependecy into Weld's module:

       

      <module xmlns="urn:jboss:module:1.0" name="org.jboss.as.weld">

       

          <resources>

              <resource-root path="jboss-as-weld-7.0.0.Beta3.jar"/>

              <!-- Insert resources here -->

          </resources>

       

          <dependencies>

              <module name="javax.ejb.api"/>

       

      Thanks