MyFaces Core
  1. MyFaces Core
  2. MYFACES-3429

ArrayIndexOutOfBoundsException in CompositeELResolver under load

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.2.12, 2.0.12, 2.1.6
    • Component/s: None
    • Labels:
      None
    • Environment:
      Tomcat 6.0.32, Tomhawk 1.1.10, RichfFaces 3.3.3, Facelets 1.1.15

      Description

      I found following exception in the logfile of an automated test. It happened right after system start when about 10 requests arrived in the same millisecond.

      http-8080-7 [ERROR] [D32BD7B2195DF1AAE182A4D24DBE11FF] PhaseListenerManager
      informPhaseListenersBefore: Exception in PhaseListener RESTORE_VIEW(1)
      beforePhase.
      java.lang.ArrayIndexOutOfBoundsException: 6
      at javax.el.CompositeELResolver.add(CompositeELResolver.java:45)
      at
      org.apache.myfaces.el.CompositeELResolver.add(CompositeELResolver.java:50)
      at
      org.apache.myfaces.el.unified.ResolverBuilderForJSP.build(ResolverBuilderForJSP.java:62)
      at
      org.apache.myfaces.el.ResolverForJSPInitializer.beforePhase(ResolverForJSPInitializer.java:54)
      at
      org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:73)
      at
      org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:93)
      at
      org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
      at
      org.apache.myfaces.custom.ppr.PPRLifecycleWrapper.execute(PPRLifecycleWrapper.java:68)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:183)
      at xxx.servlets.FacesServletWrapper.service(FacesServletWrapper.java:119)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at
      org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:392)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at xxx.filters.LoginFilter.doFilter(LoginFilter.java:211)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at xxx.filters.CacheFilter.doFilter(CacheFilter.java:104)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at xxx.filters.EncodingFilter.doFilter(EncodingFilter.java:54)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at xxx.filters.TimerFilter.doFilter(TimerFilter.java:80)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
      at
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      at
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:662)

      I created this bug first in the Tomcat issue tracker: https://issues.apache.org/bugzilla/show_bug.cgi?id=52271
      It has been closed as invalid with following statement :"It sounds as if MyFaces is trying to configure the same CompositeELResolver instance from multiple
      threads."

        Activity

        Michael Heinen created issue -
        Hide
        Leonardo Uribe added a comment -

        A double checked locking with volatile was added in that place to ensure only one thread initialize the resolver. Thanks for the report.

        Show
        Leonardo Uribe added a comment - A double checked locking with volatile was added in that place to ensure only one thread initialize the resolver. Thanks for the report.
        Leonardo Uribe made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Fix Version/s 1.2.12 [ 12319080 ]
        Fix Version/s 2.0.12 [ 12319175 ]
        Fix Version/s 2.1.6 [ 12319173 ]
        Resolution Fixed [ 1 ]
        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Michael Heinen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development