6 Replies Latest reply on Mar 13, 2008 3:12 PM by junkie

    Outjection from SLSBs

    junkie

      I'm running a Seam 1.2 / Facelets app in production. I'm experiencing an issue with all SLSBs that use outjection:


      In some cases the outjected object are NULL although the SLSB definitely created a new object for outjection.


      Sample SLSB:



      @Stateless
      @Name("bookSearch")
      public class BookSearchAction implements BookSearch {
          
        @RequestParameter String query;
      
        @Out(required=false)
        private SearchResults searchResults;
      
        ...
      }
      



      This happens rarely but it happens. I have a feeling that it happens more likely under heavy server load. Has onyone else experienced this issue?

        • 1. Re: Outjection from SLSBs
          junkie

          Also a an explicit ScopeType.EVENT for the SLSB and the outjected object does not help, I have just experienced it happen again.


          The outjected object was created and then in the xhtml page it was null.


          Looks really like a bug to me.


          No one else who had this issue?

          • 2. Re: Outjection from SLSBs
            goldmann.marek.goldmann.pl

            First - SLSB cannot provide properties to JSF components - see documentation. Change it to SFSB or at least JavaBean.



            Thomas Gerhards wrote on Mar 12, 2008 07:46 PM:


            I'm running a Seam 1.2 / Facelets app in production. I'm experiencing an issue with all SLSBs that use outjection:

            In some cases the outjected object are NULL although the SLSB definitely created a new object for outjection.

            Sample SLSB:

            @Stateless
            @Name("bookSearch")
            public class BookSearchAction implements BookSearch {
                
              @RequestParameter String query;
            
              @Out(required=false)
              private SearchResults searchResults;
            
              ...
            }
            



            This happens rarely but it happens. I have a feeling that it happens more likely under heavy server load. Has onyone else experienced this issue?


            And second - you have an annotation with required=false attribute, so if the searchResults property is null, it outjects a null value. If you are sure, that searchResults isn't a null-value, remove @Out(required=false) attribute.


            Hope this helps!

            • 3. Re: Outjection from SLSBs
              junkie

              SLSB cannot provide properties to JSF components

              You can do so if you outject, that's how it is done in the some sample Seam apps like the booking app and also you find such samples in the Seam books (like Beginning JBoss Seam).



              remove @Out(required false)

              Should not matter. I always use that when I outject as you don't have to actually create the object to not get an exception.

              • 4. Re: Outjection from SLSBs
                junkie

                Okay, I have


                1) put a SFSB in front of the SLSB: same thing happens


                2) Replaced outjection by getter: same thing happens


                On the console of my dev server I can see that the object is not null. But in the xhtml page it is.


                It only happens when I reload the page over and over very quickly.


                I'm using a page action in pages.xml.

                • 5. Re: Outjection from SLSBs
                  chawax

                  Don't know if it will help but I had problems with bijection because I forgot to add Seam interceptors in ejb-jar.xml. Have you done this ?

                  • 6. Re: Outjection from SLSBs
                    junkie

                    I have this in ejb-jar:


                    <assembly-descriptor>
                      <interceptor-binding>
                        <ejb-name>*</ejb-name>
                        <interceptor-class>
                          org.jboss.seam.ejb.SeamInterceptor
                        </interceptor-class>
                      </interceptor-binding>
                    </assembly-descriptor>