2 Replies Latest reply on Mar 13, 2006 10:42 AM by Jens Weintraut

    Don't get submitted information injected. Why?

    Jens Weintraut Apprentice

      Hi folks,

      I hope I can describe my problem a way that somebody can help me.

      I've one component managing this @DataModel. When the user selects an item from this @DataModel a page is displayed where he gets detailed information about the chosen item.
      On this page the user can enter some information and shall be able to save the changes or to switch to the next or previous item. To use those functionalities I've added some <h:commandButton>s. Their actions refer to methods located in another component.

      So I've two components: Component A manages the @DataModel, Component B shall manage switching between items and saving the current item with the changes made by the user.
      Additionally there are two pages: The first page (page A) shows the @DataModel, the second page (page B) displays the selected item and offers buttons to navigate through the other items or to save the current item.

      After showing some code, I'll describe my problem.

      Component A:

      @Stateful
      @Scope(ScopeType.SESSION)
      @LoggedIn
      @Name("showListForDevelopers")
      @Interceptors(SeamInterceptor.class)
      public class ShowListForDevelopers implements IShowListForDevelopers, Serializable {
       @PersistenceContext(unitName = "aresDatabase")
       private EntityManager em;
      
       @In @Valid
       private User user;
      
       @DataModel
       @Out
       private List<Testaction> testactions;
      
       @DataModelSelection
       @Out(required=false)
       private Testaction currentTestaction;
      
       @DataModelSelectionIndex
       @Out
       private int testactionIndex;
      
       @In(required=false)
       private Release selectedRelease;
      
       @In(required=false)
       private List<Release> allReleases;
      
       @Factory("testactions")
       public void getTestactions() {
       if(selectedRelease != null) {
       testactions = em.createQuery(
       "from Testaction where TACT_DEV_USR_ID=:dev and TACT_REL_ID=:rel and (TACT_REV_ID is null or TACT_REV_ID=9) order by TACT_ID asc"
       ).setParameter("dev", user.getID()).setParameter("rel", selectedRelease.getID()).getResultList();
       } else {
       testactions = em.createQuery(
       "from Testaction where TACT_DEV_USR_ID=:dev and (TACT_REV_ID is null or TACT_REV_ID=9) order by TACT_ID asc"
       ).setParameter("dev", user.getID()).getResultList();
       }
       testactionIndex = 0;
       if( testactions.size() > 0 ) {
       currentTestaction = testactions.get(0);
       }
       }
      
       public String select() {
       return "selected";
       }
      
       @Remove @Destroy
       public void destroy() {
       }
      }


      Page A:
      <h:form>
       <div id="release">
       <h:outputText value="#{ares_messages.release}: " />
       <h:selectOneMenu value="#{releaseSelector.selectedRelease}" onchange="submit()">
       <f:selectItems value="#{releaseSelector.releaseItems}" />
       </h:selectOneMenu>
      
       </div>
      
       <t:dataTable value="#{testactions}" var="testaction_var">
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{ares_messages.label_testaction_ID}" />
       </f:facet>
       <h:commandLink value="#{testaction_var.ID}" action="#{showListForDevelopers.select}"/>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{ares_messages.label_testaction_TCaseToken}" />
       </f:facet>
       <h:outputText value="#{testaction_var.TCaseToken}" />
       </h:column>
       </t:dataTable>
      
       <div class="errors"><h:messages globalOnly="true"/></div>
      </h:form>


      Component B:
      @Stateful
      @Scope(ScopeType.SESSION)
      @LoggedIn
      @Name("showTestactionForDevelopers")
      @Interceptors(SeamInterceptor.class)
      public class ShowTestactionForDevelopers implements IShowTestactionForDevelopers{
       @PersistenceContext(unitName = "aresDatabase", type = PersistenceContextType.EXTENDED)
       private EntityManager em;
      
       @In
       @Out
       @Valid
       private Testaction currentTestaction;
      
       @In
       @Valid
       private User user;
      
       @In
       private List<Testaction> testactions;
      
       public String saveTestaction() {
       saveCurrentTestaction();
       return "backToList";
       }
      
       //skipped the rest


      Page B:
      <h:form>
       <div class="errors"><h:messages globalOnly="true" /></div>
       <div class="buttonLine">
       <h:commandButton action="#{showTestactionForDevelopers.saveTestaction}" image="img/showTestaction.save.gif" styleClass="graphical" type="submit" />
       <h:commandButton action="#{showListForDevelopers.saveTestactionAndNext}" image="img/showTestaction.saveAndNext.gif" styleClass="graphical" type="submit" />
      
       <h:commandButton action="#{showTestactionForDevelopers.prevTestaction}" image="img/showTestaction.prev.gif" styleClass="graphical" />
       <h:outputText value="#{showTestactionForDevelopers.testactionIndexHR} | #{showTestactionForDevelopers.testactionsSize}" styleClass="indexAndSize" />
       <h:commandButton action="#{showTestactionForDevelopers.nextTestaction}" image="img/showTestaction.next.gif" styleClass="graphical" style="margin-left: 0px; margin-right: 15px;" />
       </div>
      
       <table cellpadding="0" cellspacing="0" border="0">
       <tr>
       <th><h:outputText value="#{ares_messages.label_testaction_ID}" /></th>
       <th><h:outputText value="#{ares_messages.label_testaction_RevID}" /></th>
       <th><h:outputText value="#{ares_messages.label_testaction_ChnglistID}" /></th>
       <th><h:outputText value="#{ares_messages.label_testaction_ValidatorUsrID}" /></th>
       </tr>
       <tr>
       <td><h:outputText value="#{currentTestaction.ID}" /></td>
       <td>
       <h:selectOneMenu value="#{currentTestaction.revID}">
       <f:selectItems value="#{showTestactionForDevelopers.revisions}" />
       <f:convertNumber />
       </h:selectOneMenu>
       </td>
       <td><h:inputText value="#{currentTestaction.chnglistID}"><f:convertNumber /></h:inputText></td>
       <td><h:outputText value="#{currentTestaction.validatorUsrID}" /></td>
       </tr>
       </table>
      </h:form>



      Now to my problem. When the user selects an item, its details are shown on page B. Debugging into Component B reveals that the selected item is injected from Component A. That's what I wanted.
      But when the user hits one of those <h:commandButton>s the currentTestaction is nulled instead of being updated with the entered information.

      I tried all the combinations of the attributes immediate and type of those <h:commandButton> tags. But I didn't get it to work. Everytime a method of Component B is invoked the currentTestaction is null.

      Does anybody know how to tell Seam to save all the entered information?

      Thanks
      Newlukai

        • 1. Re: Don't get submitted information injected. Why?
          Jens Weintraut Apprentice

          Hi there,

          it's me, again. Because of some ideas in another thread, I tested some settings. At the moment Component A and B now look that way:

          Component A:

          @Stateful
          @Scope(ScopeType.SESSION)
          @LoggedIn
          @Name("showListForDevelopers")
          @Interceptors(SeamInterceptor.class)
          public class ShowListForDevelopers implements IShowListForDevelopers, Serializable {
           @PersistenceContext(unitName = "aresDatabase")
           private EntityManager em;
          
           @In @Valid
           private User user;
          
           @DataModel(scope=ScopeType.PAGE)
           private List<Testaction> testactions;
           @DataModelSelectionIndex
           private int testactionIndex;
           @DataModelSelection
           private Testaction testaction;
          
           @Out(required=false)
           private List<Testaction> currentTestactions;
           @Out(required=false)
           private int currentTestactionIndex;
           @Out(required=false)
           private Testaction currentTestaction;
          
           @In(required=false)
           private Release selectedRelease;
          
           @In(required=false)
           private List<Release> allReleases;
          
           @Factory("testactions")
           public void getTestactions() {
           if(selectedRelease != null) {
           testactions = em.createQuery(
           "from Testaction where ..."
           ).getResultList();
           } else {
           testactions = em.createQuery(
           "from Testaction where ...").getResultList();
           }
           }
          
           public String select() {
           currentTestactions = testactions;
           currentTestactionIndex = testactionIndex;
           currentTestaction = testaction;
           return "selected";
           }
          
           @Remove @Destroy
           public void destroy() {
           }
          }


          Component B:
          @Stateful
          @Scope(ScopeType.SESSION)
          @LoggedIn
          @Name("showTestactionForDevelopers")
          @Interceptors(SeamInterceptor.class)
          public class ShowTestactionForDevelopers implements IShowTestactionForDevelopers{
           @PersistenceContext(unitName = "aresDatabase", type = PersistenceContextType.EXTENDED)
           private EntityManager em;
          
           @In
           @Valid
           private User user;
          
           @In
           private List<Testaction> currentTestactions;
           @In
           private int currentTestactionIndex;
           @In
           @Out
           @Valid
           private Testaction currentTestaction;
          
           private transient List<Testcase> testcases;
           private transient List<User> developers;
           private transient List<Revisionclass> revisions;
          
           public String saveTestaction() {
           saveCurrentTestaction();
           return "backToList";
           }
          
           public String saveTestactionAndNext() {
           saveCurrentTestaction();
           if(shiftTestaction(1)) {
           return "browse";
           }
           return "backToList";
           }
          
           //omitted the rest ...
          


          Because of the PAGE scope the @DataModel testactions of Component A is updated every time the user selects another filter. But to use it on the detailed page and in component B I've to copy those attributes to fields in SESSION scope. It works.

          On the detailed page I want the user be abled to enter some information and to save his changes. For this I've a form on the detailed page with submit buttons. The form shows the properties of the "currentTestaction", which was chosen on the page with the list (page A).
          With the preceding code I get this error message:



          SCHWERWIEGEND: Error Rendering View
          javax.faces.el.EvaluationException: /showTestactionForDeveloper.xhtml @18,152 value="#{showTestactionForDevelopers.testactionIndexHR} | #{showTestactionForDevelopers.testactionsSize}": $Proxy105
           at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
           at javax.faces.component.UIOutput.getValue(UIOutput.java:75)
           at org.apache.myfaces.renderkit.RendererUtils.getStringValue(RendererUtils.java:225)
           at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:65)
           at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:53)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
           at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:547)
           at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:544)
           at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:544)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:450)
           at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
           at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
           at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
           at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
           at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
           at java.lang.Thread.run(Thread.java:595)
          Caused by: javax.faces.el.EvaluationException: Bean: $Proxy105, property: testactionIndexHR
           at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:404)
           at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:71)
           at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
           at com.sun.el.parser.AstValue.getValue(AstValue.java:96)
           at com.sun.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:25)
           at com.sun.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:30)
           at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183)
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
           at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
           ... 30 more
          Caused by: java.lang.reflect.InvocationTargetException
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
           ... 38 more
          Caused by: javax.ejb.EJBException: org.jboss.seam.RequiredException: In attribute requires value for component: showTestactionForDevelopers.currentTestaction
           at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
           at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
           at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:190)
           at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
           at $Proxy105.getTestactionIndexHR(Unknown Source)
           ... 43 more
          Caused by: org.jboss.seam.RequiredException: In attribute requires value for component: showTestactionForDevelopers.currentTestaction
           at org.jboss.seam.Component.getInstanceToInject(Component.java:1164)
           at org.jboss.seam.Component.injectFields(Component.java:839)
           at org.jboss.seam.Component.inject(Component.java:669)
           at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:29)
           at sun.reflect.GeneratedMethodAccessor174.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
           at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
           at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
           at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:58)
           at sun.reflect.GeneratedMethodAccessor173.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
           at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
           at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
           at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:58)
           at sun.reflect.GeneratedMethodAccessor172.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
           at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
           at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
           at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:38)
           at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
          13:23:33,953 ERROR [STDERR] 25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
           at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
           at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
           at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:41)
           at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:120)
           at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:62)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
           ... 58 more


          Note this line:
          In attribute requires value for component: showTestactionForDevelopers.currentTestaction

          It tells me that Seam didn't apply the form values to the corresponding field of ShowTestactionForDevelopers. I don't know why. The field is annotated as @Out and @In.

          What I wanna do is: if the user clicks on "next testaction" or "previous testaction" to show him the next or previous one. So I need currentTestaction annotated as @Out. And if the user enters some information and clicks "save", I want Seam to apply all the changed information to "currentTestaction" so I can persist the changes in the action method of the save button.

          OK. After I saw the preceding error I thought I could try to mark the @In fields as @In(required=false). When I do this, I get this error:

          javax.faces.el.EvaluationException: /showTestactionForDeveloper.xhtml @18,152 value="#{showTestactionForDevelopers.testactionIndexHR} | #{showTestactionForDevelopers.testactionsSize}": $Proxy205
           at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
           at javax.faces.component.UIOutput.getValue(UIOutput.java:75)
           at org.apache.myfaces.renderkit.RendererUtils.getStringValue(RendererUtils.java:225)
           at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:65)
           at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:53)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
           at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:547)
           at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:544)
           at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:544)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:450)
           at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
           at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
           at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
           at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
           at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
           at java.lang.Thread.run(Thread.java:595)
          Caused by: javax.faces.el.EvaluationException: Bean: $Proxy205, property: testactionIndexHR
           at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:404)
           at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:71)
           at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
           at com.sun.el.parser.AstValue.getValue(AstValue.java:96)
           at com.sun.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:25)
           at com.sun.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:30)
           at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183)
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
           at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
           ... 30 more
          Caused by: java.lang.reflect.InvocationTargetException
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
           ... 38 more
          Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: could not inject: showTestactionForDevelopers.currentTestactionIndex
           at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
           at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
           at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:190)
           at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
           at $Proxy205.getTestactionIndexHR(Unknown Source)
           ... 43 more
          Caused by: java.lang.IllegalArgumentException: could not inject: showTestactionForDevelopers.currentTestactionIndex
           at org.jboss.seam.Component.setFieldValue(Component.java:1005)
           at org.jboss.seam.Component.injectFields(Component.java:839)
           at org.jboss.seam.Component.inject(Component.java:669)
           at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:29)
           at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
           at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
           at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
           at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:58)
           at sun.reflect.GeneratedMethodAccessor307.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
           at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
           at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
           at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:58)
           at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
           at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
           at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
           at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:38)
           at sun.reflect.GeneratedMethodAccessor305.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(M
          13:47:06,500 ERROR [STDERR] ethod.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
           at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
           at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
           at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:41)
           at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:120)
           at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:62)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
           at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
           ... 58 more
          Caused by: java.lang.IllegalArgumentException
           at sun.reflect.UnsafeIntegerFieldAccessorImpl.set(UnsafeIntegerFieldAccessorImpl.java:62)
           at java.lang.reflect.Field.set(Field.java:656)
           at org.jboss.seam.Component.setFieldValue(Component.java:1001)
           ... 100 more


          This is quite confusing. First I get an error, because currentTestaction isn't injected. Then I get an error because it can't be injected (doesn't matter that here stands currentTestactionIndex, I tried almost all combinations of @In and @In(required=true) for all the fields).
          I don't know what Seam is doing here. Perhaps someone can explain it to me.

          Has anybody an idea how to tell Seam, what I want Seam to do?
          If there are any questions, I will answer them.

          Thanks
          Newlukai

          • 2. Re: Don't get submitted information injected. Why?
            Jens Weintraut Apprentice

            OK. I found some errors in my code and bugfixed it. There's only one more problem. It's the problem why I started posting: Seam doesn't apply the request values to the field.

            Let me explain it. In a simple application you've a form, where the user enters some information and hits a button. Seam injects the request values to a field of a stateless bean. The method invoked saves the data and that's it.
            I want to make it possible to modify data. The user selects an item from a list, which he wants to modify. Then he is displayed a form with input fields to enter his modifications. So I already have a scoped variable which delivers the data to display. Now the user enters some information (changing or adding data) and hits "save". At this point Seam should apply all the request values (it would be nice if Seam recognized only modified values, but I think this would go to far) to the scoped variable which is displayed. Then the invoked method of the stateful component could save the variable.

            I can't say, why it doesn't work. Perhaps I made some mistakes. Perhaps I'm dealing with a bug of Seam or JBoss. I only know that Seam tries to apply 'null' instead of the entered information from the form.

            Here's the code of my component:

            @Stateful
            @Scope(ScopeType.SESSION)
            @LoggedIn
            @Name("showTestactionForDevelopers")
            @Interceptors(SeamInterceptor.class)
            public class ShowTestactionForDevelopers implements IShowTestactionForDevelopers{
             @PersistenceContext(unitName = "aresDatabase", type = PersistenceContextType.EXTENDED)
             private EntityManager em;
            
             @In
             @Valid
             private User user;
            
             @In(required=false, scope=ScopeType.EVENT)
             private List<Testaction> currentTestactions;
             @In(required=false, scope=ScopeType.EVENT)
             private Integer currentTestactionIndex;
             @In(scope=ScopeType.EVENT, required=false)
             @Out(scope=ScopeType.EVENT)
             @Valid
             private Testaction currentTestaction;
            
             private transient List<Testcase> testcases;
             private transient List<User> developers;
             private transient List<Revisionclass> revisions;
            
             public ShowTestactionForDevelopers() {
             System.out.println("Hello world");
             }
            
             public String saveTestaction() {
             saveCurrentTestaction();
             return "backToList";
             }
             //rest omitted


            And, sorry if I'm getting on your nerves.

            Thanks
            Newlukai