Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3914

Bootloader bug with DOMBuilder: java.lang.LinkageError: loader constraint violation: loader previously initiated loading for a different type with name "org/w3c/dom/NodeList"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.6, 1.7-rc-1
    • 2.0.6
    • None
    • None
    • Windows XP

    Description

      I've encountered buggy behavior with Groovy 1.6.6 and 1.7-rc-1:

      import groovy.xml.DOMBuilder

      def filePath = "MestaXml.log";
      def doc = DOMBuilder.parse(new FileReader(filePath));
      def docElm = doc.documentElement;

      $ groovy SaveTransformer.groovy
      Caught: java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>)
      previously initiated loading for a different type with name "org/w3c/dom/NodeList"
      at SaveTransformer.run(SaveTransformer.groovy:5)

      However, if I compile the class and run with java, it's fine:

      $ groovyc SaveTransformer.groovy
      $ java -cp .;groovy-all-1.6.6.jar SaveTransformer
      $

      For the case the XML file was needed:
      http://ondra.zizka.cz/stranky/programovani/java/groovy-dombuilder-bug.texy

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            pekarna Ondra Žižka
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: