2 Replies Latest reply on May 16, 2011 6:37 AM by andre.pankraz

    Status and Bug in Bridge 2.1.0

    andre.pankraz

      Hi,

       

      is the Bridge 2.1.0 (Trunk 2.1.1) still supported?

       

      I wonder, because e.g. a JUnit-Test doesn't work and the Seam support is also very problematic.

       

       

      2 examples:

       

      * GenericPortletTest.testGetBridgeClassName1()

          should fail with PortletException, message == "Can't detect bridge implementation class name"

        but if there is no META-INF/services/bridge... than we get a NullPointerException from the sun ClassLoader, not a PortletException.

        And even if there would be a PortletException, the text would be "Faces portlet Bridge implementation class not found".

        I cannot see how this test can pass (maybe older Java ClassLoader throws no NullPointer?), and this is for months now.

       

       

      *  AjaxPortletBridge.doFacesRequest(ActionRequest request, ActionResponse response)

           Seem-Actions (s:link and submits too) cannot work in any case (since 2.1.0, but in trunk too).

       

      11:01:36,420 ERROR [Exceptions] handled and logged exception

      java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)

          at org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:163)

          at org.jboss.seam.contexts.PageContext.isBeforeInvokeApplicationPhase(PageContext.java:175)

          at org.jboss.seam.contexts.PageContext.getCurrentWritableMap(PageContext.java:91)

          at org.jboss.seam.contexts.PageContext.remove(PageContext.java:105)

          at org.jboss.seam.navigation.Pages.updateStringValuesInPageContextUsingModel(Pages.java:906)

          at org.jboss.seam.jsf.SeamStateManager.saveView(SeamStateManager.java:86)

          at javax.faces.application.StateManagerWrapper.saveView(StateManagerWrapper.java:96)

          at org.jboss.portletbridge.AjaxPortletBridge.doFacesRequest(AjaxPortletBridge.java:418)

          at javax.portlet.faces.GenericFacesPortlet.processAction(GenericFacesPortlet.java:555)

          at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl$Invoker.doFilter(PortletContainerImpl.java:558)

       

       

      Code:

       

      ###

              try {

                  strategy.beforeActionRequest(facesContext);

                  processIncomingParameters(facesContext, request);

                  execute(facesContext);

                  strategy.afterActionRequestExecute(facesContext);

                  // save request scope variables and Faces Messages.

                  if (!facesContext.getResponseComplete()) {

                      // Setup portlet modes from parameters.

                      Map<String, String[]> viewIdParameters = bridgeContext.getViewIdParameters();

                      if (null != viewIdParameters && viewIdParameters.size() > 0) {

                          processPortletParameters(response, stateId, facesContext,

                                  facesContext.getViewRoot().getViewId(),

                                  viewIdParameters);

                      }

                      processOutgoingParameters(facesContext,request,response);

                      // Save view state for a render phases.

                      facesContext.getApplication().getStateManager().saveView(

                              facesContext);

                      windowState.saveRequest(facesContext, true);

      ###

       

      strategy.afterActionRequestExecute(facesContext); sets phase.id to null in finally block (performPageActions).

      A few steps later, saveView() trys to call this function in Seam:

       

         private Map<String, Object> getCurrentWritableMap()

         {

            return isBeforeInvokeApplicationPhase() ?

                  previousPageMap : nextPageMap;

         }

       

      beforeInvokeApplicationPhase has to read phase.id 0 ==> Exception. This function didn't change since Seam 2.2.0.

       

       

       

      I cannot see, how this can work for any Seam setup project, that isn't only using simple render requests. Strange for a Final version? Even 2.0.0 was better for this Use Case, beside the Conversation-problems (ejb:transaction).

      (also for Bridge 2.1.1 Trunk, Seam 2.2.2, RichFaces 3.3.3, GateIn)

       

      So my question is - is this Bridge with Seam 2.2 support still supported / in work?

      I can fix these 2 things (with quick hacks, have not the time to submerge into this stuff), but there are also some other things in the code (lots of TODO or uncommented code), that doesn't feel too well for the current project.

       

       

      Best regards,

      Andre

        • 1. Status and Bug in Bridge 2.1.0
          wesleyhales

          Hi Andre

           

           

          Andre Pankraz wrote:

           

          Hi,

           

          is the Bridge 2.1.0 (Trunk 2.1.1) still supported?

           

          I wonder, because e.g. a JUnit-Test doesn't work and the Seam support is also very problematic.

          Just checked in the fixed test. This was fallout from us trying to pass the TCK. Which we do now pass everything except JSP part.

          So my question is - is this Bridge with Seam 2.2 support still supported / in work?

          I can fix these 2 things (with quick hacks, have not the time to submerge into this stuff), but there are also some other things in the code (lots of TODO or uncommented code), that doesn't feel too well for the current project.

          Can you provide a jira issue with this use case? I would also need a simple maven project (with source) to test - just use the seam archetype and add your code from above and test it so that it works, then attach to jira.

          Yes, the 2.x version is our supported version of the bridge which will pass the TCK soon. But as always, any trunk in open source software is not guaranteed to be stable

           

           

          Thanks,

          Wesley

          • 2. Re: Status and Bug in Bridge 2.1.0
            andre.pankraz

            Hi,

             

            thx for the JUnit-fix. Thx for clarification. Trunk and 2.1.0.Final show the same behaviour...as i wrote...

             

             

             

            The Seam stuff doesn't work with page params, e.g. add to your seam booking ear in pages.xml (makes no sense, only for bug reproduction):

                <page view-id="/main.xhtml" login-required="true">

             

                    <param name="test" value="#{hotelSearch.searchString}" />

            ...

             

            Then find hotel, click on it, cancel =>

            java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)

             

             

            Problem is in seam.Pages.updateStringValuesInPageContextUsingModel() together with the stuff i described above.

            In AjaxPortletBridge.doFacesRequest(ActionRequest request, ActionResponse response) the line strategy.afterActionRequestExecute(facesContext); clears the Lifecycle.phaseId.

             

            Then saveView is called, which in turn uses updateStringValuesInPageContextUsingModel which trys to read phaseId and - BAM

            saveView()-callout needs a seam phase id!

             

            Best regards,
            André