We are gradually replacing Seam components with Spring-MVC and Spring-Webflow.
Running JMeter-tests the logs get cluttered with StackOverFlowErrors after a couple of hours:
javax.servlet.ServletException: Servlet execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
...
Caused by: java.lang.StackOverflowError
at org.jboss.seam.jsf.SeamApplication.getMessageBundle(SeamApplication.java:264)
at org.springframework.faces.webflow.FlowApplication.getMessageBundle(FlowApplication.java:214)
at org.jboss.seam.jsf.SeamApplication.getMessageBundle(SeamApplication.java:264)
at org.springframework.faces.webflow.FlowApplication.getMessageBundle(FlowApplication.java:214)
at org.jboss.seam.jsf.SeamApplication.getMessageBundle(SeamApplication.java:264)
at org.springframework.faces.webflow.FlowApplication.getMessageBundle(FlowApplication.java:214)
at org.jboss.seam.jsf.SeamApplication.getMessageBundle(SeamApplication.java:264)
So the getMessageBundle method is called by two instances: SeamApplication and FlowApplication.
Looking at the javax.faces.application.Application class it says:
"Because this instance is shared, it must be implemented in a thread-safe manner."
Maybe the two app instances are trying to access the same bundle which causes race conditions?
EDIT: After the app did not respond anymore we restarted the server and now the error shows up in another place:
Caused by: java.lang.StackOverflowError
at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:49)
at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:44)
at org.jboss.seam.core.Init.instance(Init.java:117)
at org.jboss.seam.jsf.SeamApplication$ConverterLocator.<init>(SeamApplication.java:140)
at org.jboss.seam.jsf.SeamApplication.createConverter(SeamApplication.java:122)
at org.springframework.faces.webflow.FlowApplication.createConverter(FlowApplication.java:161)
at org.jboss.seam.jsf.SeamApplication.createConverter(SeamApplication.java:126)
at org.springframework.faces.webflow.FlowApplication.createConverter(FlowApplication.java:161)
at org.jboss.seam.jsf.SeamApplication.createConverter(SeamApplication.java:126)
The last 2 lines are repeated thousands of times in the log file.
We are working with the following component-versions:
JSF-1.2
Seam-2.2.0
Spring WebFlow 2.3.4
Spring MVC 3.0.5
Updating any of the components is not an option.
SeamApplication
andFlowApplication
. Both have bugs as to properly delegating to the wrapped application of which those in Spring WebFlow is been fixed in version 2.4.0. Before posting an answer, can you please try upgrading to WebFlow 2.4.0 and let me know if that indeed solved the problem?SeamApplication
still exposes the bug in the current 2.3.1 version, but that could be solved by changing the loading order infaces-config.xml
. – BalusCApplication
implementations has really to be fixed. Otherwise, you need to hack in the source code or at least report as a bug to the responsibles and wait for an update. As to ordering, in JSF 1.x, you can force reordering by redeclaring the<application-factory>
of those libraries in right order in webapp's ownfaces-config.xml
. In JSF 2.x, you can force reordering by new<absolute-ordering>
element. In both cases, the bugfixed one must appear as the last one, so that it wraps the broken one instead of other way round. – BalusC@Named
/@EJB
resp.@FlowScoped
), but definitely not Spring MVC. – BalusC