Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4273

[regression] Internal utility classes of core leak into plugin realm

    XMLWordPrintableJSON

Details

    Description

      The current class loader hierarchy of 3.x looks like:

      • plexus.core as root realm with the contents of lib/*.jar
      • plugin: g:a:v as child of plexus.core

      This basically makes lib/*.jar completely available to the plugin realm, including classes that we don't want/need to share with plugins because they assist the implementation of the core but not the interop between core and plugin.

      The current design gives rise to errors like the linkage error reported in MNGECLIPSE-1487:

      • a plugin creates a custom URL class loader (with parent delegation) that contains project dependencies, among others xercesImpl, on top of its plugin realm
      • the plugin sets the new class loader as TCCL and invokes a tool that wants to employ a SAX parser
      • the parser factory of the JRE will search the TCCL for a suitable SAX parser and will discover xercesImpl in the TCCL
      • loading of the xerces parser triggers loading of XML11Configuration from the TCCL which inherits from ParserConfigurationSettings
      • due to parent delegation, the ParserConfigurationSettings will however be loaded from plexus.core which holds xercesMinimal
      • xercesMinimal provides an incompatbile version of ParserConfigurationSettings, which finally crashes the plugin with a linkage error

      Attachments

        Activity

          People

            bentmann Benjamin Bentmann
            bentmann Benjamin Bentmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: