5 Replies Latest reply on Feb 10, 2007 10:43 AM by hstang

    Strange Outjection Problems

    toni

      Hi,

      I'm having strange problems outjecting components into the only running conversation.

      This used to work before and since I upgraded to JBoss 4.0.5 GA I'm getting this strange behaviours.

      I double checked my application and I'm pretty sure ithat there is nothing wrong with the code.

      So I think something is wrong with my setup.

      I used the jems-installer-1.2.0.GA to install JBoss 4.0.5 GA INSTEAD of jems-installer-1.2.0.BETA. Is that ?

      Besides that I really don't know what could be wrong.

      Has anybody else ever experienced strange outjection problems, which you could fix by changing the setup (ear structure or jboss setup)??

        • 1. Re: Strange Outjection Problems

          What kinds of issues are you seeing?

          • 2. Re: Strange Outjection Problems
            toni

            To reproduce the error I wrote the following:

            Bean

            
            @Name("test")
            
            public class Test implements Serializable
            {
             String text;
            
            
             public String getText()
             {
             return text;
             }
            
             public void setText(String text)
             {
             this.text = text;
             }
            
             public String toString()
             {
             return text;
             }
            }


            SFSB

            @Stateful
            @Name("testOutjection")
            
            public class TestOutjection implements BasicTestOutjection
            {
             @In(create = true)
             EntityManager entityManager;
            
             @Out(required = false)
             Test test;
            
             @Begin(join = true)
             public String outject()
             {
             test = new Test();
             test.setText("outject");
             return "test";
             }
            
            
             public String inject()
             {
             test.setText("inject");
             return "test";
             }
            
            
             @Destroy
             @Remove
             public void destroy()
             {
            
             }
            }
            


            JSF view

            <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
            <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
            <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %>
            
            <f:view>
            
             <h:panelGrid>
            
             <h:form>
             <s:validateAll>
            
            
             <h:commandButton type="submit" value="Outject" action="#{testOutjection.outject}"/>
            
             <h:commandButton type="submit" value="Inject" action="#{testOutjection.outject}"/>
            
             </s:validateAll>
            
             </h:form>
            
             <h:messages/>
            
             </h:panelGrid>
            
            </f:view>


            I used the seam.debug page to look at the conversation. The Test Bean never shows up.

            I finally figured out why. Adding the following line to the @Out annotation will make it appear.

            scope = ScopeType.CONVERSATION

            Is that correct? Nowhere in my code I have been using this line, but I need it now. I think that it used to work well without it.

            Arent seam components outjected into the default scop of the component from where they are outjected from? And isn't the default scope CONVERSATION for SFSB?

            If somebody can maybe briefly explain this and if it has changed between releases?


            • 3. Re: Strange Outjection Problems
              toni

              Hi Norman,

              I'm still having those problems. Now I added the scope CONVERSATION to all the @Out tags, and I get other weired stuff.

              Could you please comment on this?

              • 4. Re: Strange Outjection Problems
                toni

                I also completely installed JBoss 4.0.5 GA with Seam 1.1.6 from scratch, because I did not use the BETA installer before. But it does not help.

                • 5. Re: Strange Outjection Problems

                   

                  "toni" wrote:

                  Arent seam components outjected into the default scop of the component from where they are outjected from?


                  No. The default scope of the Test component is used. Since Test is a java-bean, and the default scope of a java-bean is Event, the component will be outjected to the Event context.

                  "toni" wrote:

                  And isn't the default scope CONVERSATION for SFSB?

                  Yes, but it's not using the default scope of SFSB here.