2 Replies Latest reply on Oct 29, 2006 12:23 AM by bsheward

    Injection not happening?

      Hi,

      I have a POJO JavaBean and JSF page which sets a property in that POJO. I have Log4J output which shows the property of the POJO being set to reasonable values.

      I have a SessionBean which contains a method which should act upon that POJO. I can see the method being executed, but the @In'd property is always null.

      @Stateful
      @Scope(SESSION)
      @Name("fileCabinetSession")
      public class FileCabinetSession implements FileCabinetSessionLocal, FileCabinetSessionRemote {
      
       @In(required=true)
       private FileCabinetEntry fileCabinetEntry;
      
       public void importFile() throws Exception {
      
       if ( fileCabinetEntry == null ) {
       System.out.println( "FCE IS NULL" );
       } else {
       System.out.println( "FCE IS: " + fileCabinetEntry.toString() );
       fileCabinetService.importFile( fileCabinetEntry );
       }
       }
      


      The JSF file is:

       <h:form enctype="multipart/form-data">
       <t:inputFileUpload value="#{fileCabinetEntry.file}"/>
       <h:commandButton type="submit" value="Import New"
       action="#{fileCabinetSession.importFile}" />
       <h:messages />
       </h:form>
      


      I can see in the debug.seam page that both fileCabinetEntry and fileCabinetSession objects exist in the application context.

      Can anyone tell me why the fileCabinetEntry isn't being injected?

      Thanks!


        • 1. Re: Injection not happening?

           


          Can anyone tell me why the fileCabinetEntry isn't being injected?


          Have your declared the interceptor?

          Regards

          fhh

          • 2. Re: Injection not happening?

            fhh,

            That was exactly the problem! Thanks for your help.

            We had tried to break our application into multiple JAR files within an EAR, and of course, every JAR file needs its own ejb-jar.xml with the interceptor declaration!!