1 2 Previous Next 18 Replies Latest reply on Dec 17, 2009 7:00 AM by jaikiran Go to original post
      • 15. Re: Cannot inject field annotated with @EJB annotation
        jaikiran

        When the application is being deployed, what messages related to JNDI bindings do you see for your application? The JNDI logs will look like:

         

        17:54:50,143 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
        
                SecureProfileService/remote - EJB3.x Default Remote Business Interface
                SecureProfileService/remote-org.jboss.profileservice.spi.ProfileService - EJB3.x Remote Business Interface
        
        
        • 16. Re: Cannot inject field annotated with @EJB annotation
          sebbay
          I have the following bean 'ServiceImpl' which demands on 'BeanA' and 'BeanB':
          10:31:15,499 INFO  [JBossASKernel] installing bean: jboss.j2ee:ear=test.ear,jar=test-ejb.jar,name=ServiceImpl,service=EJB3
          10:31:15,499 INFO  [JBossASKernel]   with dependencies:
          10:31:15,499 INFO  [JBossASKernel]   and demands:
          10:31:15,499 INFO  [JBossASKernel]     jndi:test/BeanAImpl/local-com.test.BeanA
          10:31:15,499 INFO  [JBossASKernel]     jndi:test/BeanBImpl/local-com.test.BeanB

           


          BeanA is binded to the JNDI:
          10:31:37,310 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=test.ear,jar=test-ejb.jar,name=BeanAImpl,service=EJB3
          10:31:37,311 INFO  [EJBContainer] STARTED EJB: com.test.BeanAImpl ejbName: BeanAImpl
          10:31:37,807 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

               test/BeanAImpl/local - EJB3.x Default Local Business Interface
               test/BeanAImpl/local-com.test.BeanA - EJB3.x Local Business Interface

           

          For BeanB I could not find an entry like this. I get the following error instead:
          Deployment "<UNKNOWN jboss.j2ee:ear=test.ear,jar=test-ejb.jar,name=MessageArchiveServiceImpl,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jndi:test/GetPackedMessageServiceImpl/local-com.test.BeanB' **

           

          BeanA looks like this:
          @Stateless
          @TransactionManagement(value = TransactionManagementType.BEAN)
          @Interceptors( { ServiceLoggerContextInterceptor.class, TimingInterceptor.class, LoggingInterceptor.class })
          public class BeanAImpl extends SomeAbstractClass implements BeanA
          {
            
             @EJB
             private SomeOtherServiceService someOtherServiceService;
             ...
            

          BeanB looks like this:
          @Stateless
          @Interceptors(
          { ServiceLoggerContextInterceptor.class, TimingInterceptor.class, LoggingInterceptor.class })
          public class BeanBImpl implements BeanB
          {
             @EJB
             private SomeOtherServiceService2  someOtherServiceService2;

            
          Could the missing '@TransactionManagement(value = TransactionManagementType.BEAN)' be the reason for my faults?

           

          What is the meaning of this annotation?

           

          Best regards
          • 17. Re: Cannot inject field annotated with @EJB annotation
            sebbay

            Hello,

             

            I figured out the reason for my problem. The reason was, that Bean1 demands on Bean2, Bean2 demands on Bean3 and Bean3 demands on Bean1!!!

             

            Can I configure JBoss, to ignore these demands?

             

            Best regards

            sebbay

            • 18. Re: Cannot inject field annotated with @EJB annotation
              jaikiran
              1 2 Previous Next