Java. lang. LinkageError occurs in Groovy 1.5.7.

Source: Internet
Author: User
Tags xml parser groovy script

Recently, when writing a test script in Groovy, a problem occurs. In Groovy 1.5.7, groovy reads a built-in dom Processing Package (org. w3c. dom), and groovy script used in the watij library contains the xml-apis.jar conflict, because the version is not the same.

 

The following error is reported:

Caught: java. lang. LinkageError: loader constraint violation: loader (instance of <bootloader>) previviusly initiated loading for a different type with name "org/w3c/dom/NamedNodeMap"

After checking the information on the Internet for a long time, I finally found http://jira.codehaus.org/browse/policy-3356. I found that it was originally a groovy bug. The current status of this bug is open. The related description of this bug:

With Groovy versions 1.5.7 onwards there is a problem where Groovy loadsDOM classes from the Java SDK in its RootLoader constructor. This makes it incompatible with XML parsing libraries having differentversions of DOM interfaces. For example, with Oracle XML Parser I get:

 

 

 

Since it has not been fixed yet, I tried to return to groovy 1.5.6. Well, no error is reported. It seems that it is a problem of 5.7.

 

Forget it. Use 1.5.6 first. The difference is not big.

If any expert can find a better solution, please do not hesitate to give me some advice!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.