3 Replies Latest reply on Feb 21, 2012 3:03 PM by lightguard

    JBoss 7.1.0 Final: s:viewAction doesn't cast viewParam correctly

    lukascz

      So far I was using JBoss 7.0.2Final without any problems. Today, I switched to JBoss 7.1.0.Final and I'm facing following problem. (I use Seam 3.1.0Final)

       

      On page I use f:viewParam and s:viewAction as follows:

       

      {code:xml}<f:viewParam name="entityId" value="#{selectedEntity}" />

      <s:viewAction

              action="#{entitySelection.selectEntityById(selectedEntity)}" />{code}

       

      The problem parameter of method entitySelection.selectEntityById is Long and not String. However, this fails because it's looking for a method with string parameter. I will get than following exception:

       

       

      Caused by: javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: /private/foo/bar.xhtml @23,73 action="#{entitySelection.selectEntityById(selectedEntity)}": Method not found: Proxy for view class: com.foo.bar.EntitySelection of EJB: EntitySelection.selectEntityById(java.lang.String)

          at org.jboss.seam.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:65) [seam-faces-api.jar:3.1.0.Final]

          at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at org.jboss.seam.faces.component.UIViewAction.broadcast(UIViewAction.java:381) [seam-faces-api.jar:3.1.0.Final]

          at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          ... 31 more

       

       

      If try to invoke method action="#{entitySelection.selectEntityById(selectedEntity)}" using commandButton, it works fine.

       

      Then, I tried this in the seam-booking example and it fails as well:

      {quote}

      javax.el.MethodNotFoundException: /hotel.xhtml @14,74 action="#{bookingAgent.selectHotel(hotelId)}": Method not found: Proxy for view class: org.jboss.seam.examples.booking.booking.BookingAgent of EJB: BookingAgent.selectHotel(java.lang.String)

      {quote}

       

      Any ideas?

       

      Thanks,

      Lukas