XalanJ2
  1. XalanJ2
  2. XALANJ-1707

Use of ContextClassLoader is not appropriate

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.7
    • Fix Version/s: None
    • Component/s: Other
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • Labels:
      None
    • Environment:
      Operating System: Other
      Platform: Other

      Description

      On jdk >=1.2 (but <1.4) xalan uses the ContextClassLoader to load classes of
      its own distribution. This is never appropriate and will lead to
      ClassCastException in a J2EE setting.

      For loading classes of its own distribution, the (current) ClassLoader that has
      loaded the distribution classes (i.e. xalan.jar) should be used.

      Glory Details:
      --------------
      The problem shows up when there is a (outdated) xalan in your (ClassLoader)
      path but you want to use a newer version of xalan in your application. Note
      that this is NOT an obscure setting but the normal case in every J2EE (1.3)
      application because you are guarantied to have JAXP XML access, but often to an
      outdated product (in my case I'm using IBM WAS 5.0.1 on Solaris).

      In principle the problem is the same as reported for xerces
      http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24244 . This is because the
      offending class is the same in both distributions:
      org.apache.xml.utils.ObjectFactory.

        Activity

        Thomas Pasch created issue -
        Serge Knystautas made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 24245 26616
        Henry Zongaro made changes -
        Priority Major [ 3 ]
        Jeff Turner made changes -
        Bugzilla Id 24245
        Description On jdk >=1.2 (but <1.4) xalan uses the ContextClassLoader to load classes of
        its own distribution. This is never appropriate and will lead to
        ClassCastException in a J2EE setting.

        For loading classes of its own distribution, the (current) ClassLoader that has
        loaded the distribution classes (i.e. xalan.jar) should be used.

        Glory Details:
        --------------
        The problem shows up when there is a (outdated) xalan in your (ClassLoader)
        path but you want to use a newer version of xalan in your application. Note
        that this is NOT an obscure setting but the normal case in every J2EE (1.3)
        application because you are guarantied to have JAXP XML access, but often to an
        outdated product (in my case I'm using IBM WAS 5.0.1 on Solaris).

        In principle the problem is the same as reported for xerces
        http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24244 . This is because the
        offending class is the same in both distributions:
        org.apache.xml.utils.ObjectFactory.
        Environment Operating System: Other
        Platform: Other
        Operating System: Other
        Platform: Other
        Brian Minchau made changes -
        Affects Version/s 2.5 [ 10870 ]
        Affects Version/s Latest Development Code [ 10863 ]
        Brian Minchau made changes -
        Affects Version/s Latest Development Code [ 10863 ]
        Affects Version/s 2.7 [ 11080 ]
        Mark Thomas made changes -
        Workflow jira [ 36611 ] Default workflow, editable Closed status [ 12570756 ]
        Mark Thomas made changes -
        Assignee Xalan Developers Mailing List [ xalan-dev@xml.apache.org ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12570756 ] jira [ 12594733 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Thomas Pasch
          • Votes:
            3 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development