Status and Bug in Bridge 2.1.0
andre.pankraz May 9, 2011 5:42 AMHi,
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