Announcement Announcement Module
No announcement yet.
Spring Web Flow + JBoss Richfaces - Intermittent NullPointerException Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Web Flow + JBoss Richfaces - Intermittent NullPointerException

    I am using Spring Web Flow with JBoss Richfaces to develop my application.

    Environment and library used:
    - Websphere 6.1
    - Spring Framework 2.5.6.SEC01
    - Spring Webflow 2.0.8.RELEASE
    - Spring Security 2.0.5.RELEASE
    - JBoss Richfaces 3.3.2.SR1

    However, in my application, when users are using the application, it will intermittently show the "Internal Server 500" error page. In the system log, the following exception was logged:

    [1/4/10 14:26:14:777 HKT] 0000003b BaseXMLFilter E org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter Exception in the filter chain
    org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is java.lang.NullPointerException
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
    at org.springframework.web.servlet.FrameworkServlet.d oGet(
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    at vice(
    at vice(
    at oFilter(
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(Base
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseF
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHa ndleRequest(
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter .java:515)
    at er.doFilter(
    at oFilter(
    at $VirtualFilterChain.doFilter( :378)
    at ecurityInterceptor.invoke(FilterSecurityIntercepto
    at ecurityInterceptor.doFilter(FilterSecurityIntercep
    at $VirtualFilterChain.doFilter( :390)
    at tectionFilter.doFilterHttp(SessionFixationProtecti
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at onFilter.doFilterHttp(ExceptionTranslationFilter.j ava:101)
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at nonymousProcessingFilter.doFilterHttp(AnonymousPro
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at rMeProcessingFilter.doFilterHttp(RememberMeProcess
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at xtHolderAwareRequestFilter.doFilterHttp(SecurityCo
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at cessingFilter.doFilterHttp(BasicProcessingFilter.j ava:174)
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at nPageGeneratingFilter.doFilterHttp(DefaultLoginPag
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at Filter.doFilterHttp( 278)
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at eAuthenticatedProcessingFilter.doFilterHttp(Abstra
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at seProcessingFilter.doFilterHttp(HostBaseProcessing
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at r.doFilterHttp(
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at ntextIntegrationFilter.doFilterHttp(HttpSessionCon
    at er.doFilter(
    at $VirtualFilterChain.doFilter( :390)
    at .doFilter(
    at org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(
    at org.springframework.web.filter.DelegatingFilterPro xy.doFilter(
    at er.doFilter(
    at oFilter(
    at doFilter(
    at .doFilter(
    at .doFilter(
    at dleRequest(
    at andleRequest(
    at r.handleRequest(
    at (
    at st(
    at y(
    at nk.handleDiscrimination(
    at nk.handleNewInformation(
    at llback.complete(
    at$ SSLReadCompletedCallback.complete(SSLReadServiceCo
    at ner.futureCompleted( :165)
    at k(
    at Actions(
    at .java:136)
    at oop(
    at$ .java:873)
    at$ ava:1473)
    Caused by: java.lang.NullPointerException

    [1/4/10 14:26:14:780 HKT] 0000003b WebApp E [Servlet Error]-[Spring Web MVC Dispatcher Servlet]: java.lang.NullPointerException

    But when the user refresh the page, it can be displayed again.

    Actually I don't know whether it's WebFlow problem or Richfaces problem, because it seems that the exception is thrown by the Richfaces ajax4jsf filter.

    I have attached the web.xml and webflow config file for reference.

    Any idea about the problem are very welcome.

    Thanks a lot

  • clarenceho

    Seems no one had used the combination like me before, doesn't get any response for more than half year.

    But finally I manged to "workaround" for this issue, would like to share here to see if anyone are having the same problem like me without any help.

    I had modified the SWF (Spring Web Flow) config to the following:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns=""

    <utilroperties id="astrauiProperties" location="classpath:/"/>

    <bean id="uiConfig" init-method="init">
    <property name="properties" ref="astrauiProperties" />
    <property name="systemApplicationDateBO" ref="systemApplicationDateBO"/>

    <bean id="localeConfig" scope="session">

    <!-- Prepare message source from resource bundle used in UI -->
    <bean id="messageSource">
    <property name="basenames">

    <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
    <webflow:listener ref="securityFlowExecutionListener" />

    <webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices">
    <webflow:flow-location path="flow/main/main.xml" />
    <webflow:flow-location path="flow/customer/customer.xml" />
    <webflow:flow-location path="flow/batch/batch.xml" />
    <webflow:flow-location path="flow/batchJobStatus/batchJobStatus.xml" />
    <webflow:flow-location path="flow/batchDownloadAdmin/batchDownloadAdmin.xml" />
    <webflow:flow-location path="flow/upload/upload.xml" />
    <webflow:flow-location path="flow/txnConfirm/txnConfirm.xml" />
    <webflow:flow-location path="flow/txnConfirmDownload/txnConfirmDownload.xml" />
    <webflow:flow-location path="flow/stmtRmk/stmtRmk.xml" />
    <webflow:flow-location path="flow/usermaint/usermaint.xml" />
    <webflow:flow-location path="flow/apiusermaint/apiusermaint.xml" />
    <webflow:flow-location path="flow/userrpt/userrpt.xml" />
    <webflow:flow-location path="flow/fileDownload/fileDownload.xml" />
    <webflow:flow-location path="flow/pinSlip/pinSlip.xml" />
    <webflow:flow-location path="flow/boetest/boetest.xml" />
    <!--webflow:flow-builder /-->

    <!-- Configures the Spring Web Flow JSF integration -->
    <faces:flow-builder-services id="facesFlowBuilderServices" />

    <!-- Enable FlowHandler URL Mapping -->
    <property name="flowExecutor" ref="flowExecutor"/>

    <!-- Map request paths to flows in the flowRegistry -->
    <property name="flowRegistry" ref="flowRegistry"/>
    <property name="defaultHandler">
    <!-- If no flow match, map path to a view to render; e.g. the "/intro" path would map to the view named "intro" -->
    <bean />
    <property name="order" value="0"/>

    <!-- Maps logical view names to Facelet templates in /WEB-INF (e.g. 'search' to '/WEB-INF/search.xhtml' -->
    <bean id="faceletsViewResolver">
    <property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
    <property name="prefix" value="/WEB-INF/" />
    <property name="suffix" value=".xhtml" />

    <!-- Dispatches requests mapped to org.springframework.web.servlet.mvc.Controller implementations -->
    <bean />



    Major highlights:
    - take away all flow execution listener
    - use FlowHandlerMapping instead of FlowController, and disable the Richfaces AjaxHandler integration
    - modify the page that having problem on the following tags after I made the change:
    - <rich:messages>
    - <a4jaram>
    - not to use "NodeSelectListener" in the tree view

    After that, the NullPointerException doesn't appear again.

    The experience is really painful, and I don't think I will use this combination in new projects at the moment.

    I saw that Spring Web Flow team is working with PrimeFaces team in the upcoming 2.2 version, and seems quite promising.

    I think I will move to one of the following in my future project:
    - Continue to use Spring Web Flow, but switch to PrimeFaces (still need to test it thoroughly in WebSphere, I will try Websphere 7.0 in new projects)
    - Switch from JSF to use GWT (Spring is also building a tighter integration with GWT)

    Hope my experience can help out others having the same problem but not able to get help from anywhere.


    Leave a comment: