1 Reply Latest reply on Jan 26, 2013 1:47 PM by alesj

    @Inject in Custom JBoss Module

    jboss123user

      I have the following in a custom module:

       

       

          import javax.inject.Inject;

          import org.slf4j.Logger;

       

          ...

       

          @Inject

          private Logger logger;

       

          ...

       

       

      In my module.xml i have the following dependencies:

       

       

         <dependencies>

           <module name="javaee.api"/>

           <module name="org.slf4j"/>

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

           <module name="javax.api"/>

           

         </dependencies>  

       

       

       

       

      The logger above is never set however if i do the following i can create the logger:

      Logger logger2 = LoggerFactory.getLogger(this.getClass());

       

       

      Does CDI work in Custom modules or am i missing something here?