Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-4957

javax.el.CompositeELResolver is not thread-safe

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.1.5, 2.2, 2.2.1, 3.0.0
    • Fix Version/s: 2.1.5, 2.2.1
    • Component/s: specs
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      A user reported that they get an intermittent NullPointerException:

      17:08:45,133 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      java.lang.NullPointerException
      at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
      at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.access$301(FacesCompositeELResolver.java:46)
      at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver$4.invoke(FacesCompositeELResolver.java:108)
      at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.invoke(FacesCompositeELResolver.java:148)
      at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:104)
      at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
      at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61)
      at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
      at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:925)
      ...

      The only way I can explain this exception is that multiple threads are simultaneously invoking add() (and the resolvers[] array is becoming corrupted). Or multiple threads are simultaneously accessing add() and getValue() (and getValue() is accessing an uninitialized array element).

      The EL spec is silent on thread-safety issues for CompositeELResolver (though it does identify thread safety issues for some other classes). I don't see anything spec-wise that prevents multi-threaded access to CompositeELResolver. If anyone has other opinions, let me know. Otherwise, looks like we need to close some timing windows in CompositeELResolver.

        Attachments

          Activity

            People

            • Assignee:
              kevan Kevan Miller
              Reporter:
              kevan Kevan Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: