Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.2-EE-GA_P02
-
Fix Version/s: EE-1.8.2.GA_P03
-
Component/s: Framework
-
Labels:None
-
Environment:ICEFaces 1.8 P02, Spring webflow 1.0.5, WebSphere AS
Description
There are a couple of Spring Webflow related issues reported. This case details ongoing efforts in both.
What we have is an application that wont start in Websphere. Trying to load the initial page shows the following error in the log:
Caused by: java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
at com.ibm.ws.webcontainer.srt.SRTServletResponse.getWriter(SRTServletResponse.java:591)
at com.sun.facelets.FaceletViewHandler.createResponseWriter(FaceletViewHandler.java:414)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:150)
at org.springframework.faces.webflow.JsfView.render(JsfView.java:97)
at org.springframework.webflow.engine.ViewState.render(ViewState.java:253)
at org.springframework.webflow.engine.ViewState.resume(ViewState.java:208)
at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
What we have is an application that wont start in Websphere. Trying to load the initial page shows the following error in the log:
Caused by: java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
at com.ibm.ws.webcontainer.srt.SRTServletResponse.getWriter(SRTServletResponse.java:591)
at com.sun.facelets.FaceletViewHandler.createResponseWriter(FaceletViewHandler.java:414)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:150)
at org.springframework.faces.webflow.JsfView.render(JsfView.java:97)
at org.springframework.webflow.engine.ViewState.render(ViewState.java:253)
at org.springframework.webflow.engine.ViewState.resume(ViewState.java:208)
at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
It turns out that WebSphere isn't properly honoring the Servlet load-on-startup setting. The side effect of this is that the SpringWebflowInstantiationServlet (hereafter: SWfIS) isn't being loaded prior to the PersistentFacesServlet, and the SeamUtilities class that is attempting to determine if Spring is present is failing. I'm not sure what the actual result of this is, there are a few places where decisions are made using the Spring flag, but it's safe to say this application wont work if this flag is wrong.
It's apparent that the code in SeamUtilities is misplaced, and that the detection of whether Spring is present belongs in the SWfIS. In WebSphere it is eventually loaded, and it could set a flag in SeamUtilities (in order to minimize the API disruption the isSpringEnvironment method should remain in SeamUtilities) when it is loaded.
For the purpose of this customer, it's simple enough to remove part of the test on line 504 of SeamUtilities:
try
{ springClass = Class.forName(SPRING_CONTEXT_HOLDER); }catch (Throwable t) {
{ log.debug("Spring webflow 2.x not detected: " + t); }if (log.isDebugEnabled())
}
{ log.debug("Spring webflow detected: " + springClass); }if (null != springClass && springWebFlowConfigured() ) { <---------------------- Line 504
springLoaded = 2;
if (log.isDebugEnabled())
}
To this:
if (null != springClass ) { <---------------------- Line 504
springLoaded = 2;
That allows the Spring detection code to work as required.