Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 917281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:11:13+00:00 2026-05-15T18:11:13+00:00

In my project, there are 2 libraries, each of which depend on the XML

  • 0

In my project, there are 2 libraries, each of which depend on the XML parsing class java.xml.parsers.DocumentBuilderFactory. Each of these libraries reference the file from different jar (one gets it from a jar called xmlParserAPIs while another gets it from xml-apis-1.0.b2.jar). Unfortunately there are different versions of the class in each of these files so I am seeing runtime errors, depending on the order they are loaded. Both of these xml jars are transitive dependencies of 3rd party libraries. Is there a good way to handle this conflict?

edit: I’m not sure if it makes a difference on how to handle the problem but this only happens in testing because one of the dependencies is in the test scope.

thanks,
jeff

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:11:14+00:00Added an answer on May 15, 2026 at 6:11 pm

    (…) Unfortunately there are different versions of the class in each of these files so I am seeing runtime errors, depending on the order they are loaded.

    In theory, xml-apis.jar and xmlParserAPIs.jar (from xerces2-j) are the same JARs but with different names, xmlParserAPIs.jar being deprecated for years (see this message and this one).

    If your dependencies relies on different and incompatible versions of xml-apis.jar, I would say that these dependencies are mutually exclusive, in other words incompatible, at least for the versions you’re using. The only solution would be to find versions with a converging dependency.

    In case they could use compatible versions, use a dependency exclusion for xmlParserAPIs.jar to use xml-api.jar only.

    I’m not sure if it makes a difference on how to handle the problem but this only happens in testing because one of the dependencies is in the test scope.

    No, this just explains why you don’t get the problem at runtime (because the test scoped is not on the classpath then and, obviously, doesn’t conflict).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hava a Java project that relies on several libraries, which are distributed as
I'm porting an msvc project, which has several libraries and each library has specific
In my project there are large no. of FIXME / TODO which are to
Is there a jQuery project out there, that create on of these Password-strength-meters right
There are few open source projects/APIs/libraries that we use in our project ( Spring,
I have a workspace with a project which links with the static libraries in
I'm have a Ruby on Rails project which displays illustrations. There are category links
As everybody, I use in my project many libraries and methods. For each method,
Our project uses several third-party open-source libraries, some of which require custom modifications. For
In my project there are some 'Prototype' factories that create instances by cloning a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.