0 Replies Latest reply on Nov 24, 2014 8:10 PM by Ben Gao

    sometimes jboss eap5.1.2 not inject ejb to BackBean,in TomcatInjectionContainer the encInjections no the backbean annotation thing

    Ben Gao Novice

      my application faceconfig.xml has hundreds of  backbean . some backbean can not inject ejb.

      for example ,the CharaGrpDefTmpMB can not inject ejb ,but I move this Bean to faceconfig different lines. THE BEAN IS OK,but other ok bean then not inject ejb.

       

       

      SO I debug the myface source and jboss source.I found in org.jboss.web.tomcat.service.TomcatInjectionContainer  class

      The following methods,the   Map<AccessibleObject, Injector> injectors = encInjections.get(clazz.getName());  theinjectors is NULL.

        private Map<AccessibleObject, Injector> getEncInjectionsForClass(Class<?> clazz, boolean isDynamic)

         {

            if (clazz == null || clazz == Object.class)

               return null;

       

       

            Map<AccessibleObject, Injector> injectors = encInjections.get(clazz.getName());

            Map<AccessibleObject, Injector> additionalInjectors = null;

            if (clazz.getSuperclass() != null && !isDynamic)

               additionalInjectors = getEncInjectionsForClass(clazz.getSuperclass(), isDynamic);

       

       

            if (injectors == null)

               return additionalInjectors;

            else if (additionalInjectors != null)

               injectors.putAll(additionalInjectors);

       

       

            return injectors;

         }

       

       

      my class:

      public class CharaGrpDefTmpMB {

      @EJB

        private CharaGrpDefTmpSBLocal charaGrpDefTmpSB;

        @EJB

        private CupBranchAuthSBLocal cupBranchAuthSB;

        @EJB

        private CharaGrpDefBatchSyncSBLocal charaGrpDefBatchSyncSB;

      .......

       

      }

       

       

      jboss version:jboss eap 5.1.2

      myface:2.0.15