Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-142

NPE as follow-up to a ClassNotFoundException caused by a wrongly stuffed OGNL context

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 3.0
    • None
    • Framework
    • None
    • Operating System: Windows XP
      Platform: PC
    • 27954

    Description

      Description

      NPE as follow-up to a ClassNotFoundException caused by a wrongly stuffed OGNL
      context

      Reason:

      org.apache.tapestry.pageload.PropertyInitializer#prepareInvariant

      contains the line

      else if (Ognl.isConstant(_expression))

      OGNL then uses the ognl.DefaultClassResolver which
      loads classes by "Class.forName()".
      In webapp with jars spread all over the ear this can
      cause ClassNotFoundExceptions.

      Solution:

      Change in

      org.apache.tapestry.pageload.PropertyInitializer#prepareInvariant

      the line

      else if (Ognl.isConstant(_expression))

      to

      else if (Ognl.isConstant(_expression, Ognl.createDefaultContext(null,
      _resolver)))

      and the tapestry classloading mechanism is used. This works even well in jar
      spreading webapps.

      Attachments

        Issue Links

          Activity

            People

              hlship Howard Lewis Ship
              frericksm Michael Frericks
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: