2 Replies Latest reply on Aug 12, 2010 7:29 AM by nbelaevski

    Spring Web Flow + JBoss Richfaces - Intermittent NullPointerException

    clarenceho
      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(FrameworkServlet.java:583)
      at org.springframework.web.servlet.FrameworkServlet.d   oGet(FrameworkServlet.java:501)
      at javax.servlet.http.HttpServlet.service(HttpServlet   .java:743)
      at javax.servlet.http.HttpServlet.service(HttpServlet   .java:856)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser   vice(ServletWrapper.java:1068)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser   vice(ServletWrapper.java:1009)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d   oFilter(WebAppFilterChain.java:145)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(Base   XMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseF   ilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHa   ndleRequest(BaseFilter.java:388)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter   .java:515)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp   er.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d   oFilter(WebAppFilterChain.java:130)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :378)
      at org.springframework.security.intercept.web.FilterS   ecurityInterceptor.invoke(FilterSecurityIntercepto  r.java:109)
      at org.springframework.security.intercept.web.FilterS   ecurityInterceptor.doFilter(FilterSecurityIntercep  tor.java:83)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.ui.SessionFixationPro   tectionFilter.doFilterHttp(SessionFixationProtecti  onFilter.java:67)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.ui.ExceptionTranslati   onFilter.doFilterHttp(ExceptionTranslationFilter.j  ava:101)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.providers.anonymous.A   nonymousProcessingFilter.doFilterHttp(AnonymousPro   cessingFilter.java:105)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.ui.rememberme.Remembe   rMeProcessingFilter.doFilterHttp(RememberMeProcess  ingFilter.java:116)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.wrapper.SecurityConte   xtHolderAwareRequestFilter.doFilterHttp(SecurityCo   ntextHolderAwareRequestFilter.java:91)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.ui.basicauth.BasicPro   cessingFilter.doFilterHttp(BasicProcessingFilter.j  ava:174)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.ui.webapp.DefaultLogi   nPageGeneratingFilter.doFilterHttp(DefaultLoginPag   eGeneratingFilter.java:86)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.ui.AbstractProcessing   Filter.doFilterHttp(AbstractProcessingFilter.java:  278)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.ui.preauth.AbstractPr   eAuthenticatedProcessingFilter.doFilterHttp(Abstra   ctPreAuthenticatedProcessingFilter.java:69)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at com.jpmorgan.awm.jfam.astra.security.filter.HostBa   seProcessingFilter.doFilterHttp(HostBaseProcessing  Filter.java:167)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.ui.logout.LogoutFilte   r.doFilterHttp(LogoutFilter.java:89)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.context.HttpSessionCo   ntextIntegrationFilter.doFilterHttp(HttpSessionCon   textIntegrationFilter.java:235)
      at org.springframework.security.ui.SpringSecurityFilt   er.doFilter(SpringSecurityFilter.java:53)
      at org.springframework.security.util.FilterChainProxy   $VirtualFilterChain.doFilter(FilterChainProxy.java  :390)
      at org.springframework.security.util.FilterChainProxy   .doFilter(FilterChainProxy.java:175)
      at org.springframework.web.filter.DelegatingFilterPro   xy.invokeDelegate(DelegatingFilterProxy.java:236)
      at org.springframework.web.filter.DelegatingFilterPro   xy.doFilter(DelegatingFilterProxy.java:167)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp   er.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d   oFilter(WebAppFilterChain.java:130)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._   doFilter(WebAppFilterChain.java:87)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager   .doFilter(WebAppFilterManager.java:771)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager   .doFilter(WebAppFilterManager.java:679)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.han   dleRequest(ServletWrapper.java:539)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.h   andleRequest(ServletWrapper.java:478)
      at com.ibm.ws.webcontainer.servlet.CacheServletWrappe   r.handleRequest(CacheServletWrapper.java:90)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest   (WebContainer.java:744)
      at com.ibm.ws.wswebcontainer.WebContainer.handleReque   st(WebContainer.java:1455)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.read   y(WCChannelLink.java:115)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi   nk.handleDiscrimination(HttpInboundLink.java:454)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi   nk.handleNewInformation(HttpInboundLink.java:383)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCa   llback.complete(HttpICLReadCallback.java:102)
      at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$   SSLReadCompletedCallback.complete(SSLReadServiceCo  ntext.java:1818)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListe   ner.futureCompleted(AioReadCompletionListener.java  :165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallbac   k(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletion   Actions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture   .java:136)
      at com.ibm.io.async.ResultHandler.complete(ResultHand   ler.java:195)
      at com.ibm.io.async.ResultHandler.runEventProcessingL   oop(ResultHandler.java:743)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler   .java:873)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j  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
      Clarence
        • 1. Re: Spring Web Flow + JBoss Richfaces - Intermittent NullPointerException
          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="http://www.springframework.org/schema/beans"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:webflow="http://www.springframework.org/schema/webflow-config"
                 xmlns:faces="http://www.springframework.org/schema/faces"
                 xmlns:util="http://www.springframework.org/schema/util"
                 xsi:schemaLocation="
                     http://www.springframework.org/schema/beans
                     http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                     http://www.springframework.org/schema/webflow-config
                     http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd
                     http://www.springframework.org/schema/faces
                     http://www.springframework.org/schema/faces/spring-faces-2.0.xsd
                     http://www.springframework.org/schema/util
                     http://www.springframework.org/schema/util/spring-util-2.5.xsd"          
                     >
                    
              <util:properties id="astrauiProperties" location="classpath:/astra-ui.properties"/>          
                    
              <bean id="uiConfig" init-method="init">
                  <property name="properties" ref="astrauiProperties" />
                  <property name="systemApplicationDateBO" ref="systemApplicationDateBO"/>
              </bean>          
                    
              <bean id="localeConfig" scope="session">
              </bean>             

           

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

           

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

           

              <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 /-->
              </webflow:flow-registry>

           

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

           

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

           

              <!--  Map request paths to flows in the flowRegistry -->
              <bean>
                  <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>       
                  <property name="order" value="0"/>
              </bean>
             
              <!-- 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" />
              </bean>
             
              <!-- Dispatches requests mapped to org.springframework.web.servlet.mvc.Controller implementations -->
              <bean />

           

                 
          </beans>

          -------------------------------------------------------------

           

          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>

            - <a4j:param>

          - 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

          - Switch from JSF to use GWT (Spring is also building a tighter integration with GWT)

           

          Clarence

          • 2. Re: Spring Web Flow + JBoss Richfaces - Intermittent NullPointerException
            nbelaevski

            Clarence,

             

            Some posts are being missed because of releases, holidays, vacations, exhibitions, huge forum traffic, etc. So please do up the questions that didn't get answered, we'll take a look.

             

            List of limitations is really a huge - we can take a look at these issues, however can you please post more detailed problem description together with small test applications into JIRA ? BTW, have you tried RF 3.3.3.Final?

             

            JSF 2.0 provides big piece of RF 3.x functionality out of the box: AJAX built-in and AJAX behavior, resources fwk., etc. So, I expect that RF 4 will work with future (JSF2-enabled) versions of WF much more smoothly, than 3.x, because most integration points are standardized now.