Jetty
  1. Jetty
  2. JETTY-1226

"javax.activation" needs to be listed in the system classes

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.11
    • Fix Version/s: 6.1.25
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      1

      Description

      I can't seem to reopen JETTY-420, so I'm filing this separately.

      Jetty includes "javax.xml" in the list of packages that the WebAppClassLoader always consults the parent first (I'll call such packages as "pass-through" packages.) In JRE6, rt.jar now contains javax.xml.soap.AttachmentPart (a part of SAAJ API), which refers to javax.activation.DataHandler.

      However, "javax.activation" is not listed as a pass-through package. As a result, if the web application directly references DataHandler and also uses SAAJ, it'll result in a classloader constraint violation. This is the root cause of JETTY-420.

      Unfortunately, applications that need to run on Java5 needs to bundle activation.jar and SAAJ, thus there's nothing apps can do to avoid this bug.

      In general, everything referenced by pass-through packages need to be also listed as a pass-through packages to avoid such a constraint violation.

      In this case, the fix is to add "javax.activation" to the list of system classes. This definition is given in WebbAppContext._systemClasses.

        Activity

        Hide
        Joakim Erdfelt added a comment -

        Per the code ...

            private String[] _systemClasses = {
                    "java.",                           // Java SE classes (per servlet spec v2.5 / SRV.9.7.2)
                    "javax.",                          // Java SE classes (per servlet spec v2.5 / SRV.9.7.2)
        

        It appears that javax.activation is already covered by the "javax." definition.

        Show
        Joakim Erdfelt added a comment - Per the code ... private String[] _systemClasses = { "java.", // Java SE classes (per servlet spec v2.5 / SRV.9.7.2) "javax.", // Java SE classes (per servlet spec v2.5 / SRV.9.7.2) It appears that javax.activation is already covered by the "javax." definition.
        Hide
        Kohsuke Kawaguchi added a comment -

        I checked 6.1.24 and I don't see that line...

        Show
        Kohsuke Kawaguchi added a comment - I checked 6.1.24 and I don't see that line...
        Hide
        Michael Gorovoy added a comment -

        Joakim was apparently quoting the contents of corresponding Jetty 7 class. I have created a patch for Jetty 6 that brings its system and server class designations up to date.

        Show
        Michael Gorovoy added a comment - Joakim was apparently quoting the contents of corresponding Jetty 7 class. I have created a patch for Jetty 6 that brings its system and server class designations up to date.
        Hide
        Michael Gorovoy added a comment -

        Updated _systemClasses and _serverClasses lists.

        Show
        Michael Gorovoy added a comment - Updated _systemClasses and _serverClasses lists.
        Hide
        Greg Wilkins added a comment -

        Applied

        Show
        Greg Wilkins added a comment - Applied
        Hide
        Greg Wilkins added a comment -

        Oops, it has broken something... backing out.

        Show
        Greg Wilkins added a comment - Oops, it has broken something... backing out.
        Hide
        Greg Wilkins added a comment -

        I've check in a simplified solution that changes far less from 6.1.24.

        Show
        Greg Wilkins added a comment - I've check in a simplified solution that changes far less from 6.1.24.
        Hide
        Jesse McConnell added a comment -

        closing resolved issues

        Show
        Jesse McConnell added a comment - closing resolved issues

          People

          • Assignee:
            Michael Gorovoy
            Reporter:
            Kohsuke Kawaguchi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: