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 8440891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:25:26+00:00 2026-06-10T08:25:26+00:00

I have a web application on tomcat. The application needs two SAXParserFactory implements: one

  • 0

I have a web application on tomcat. The application needs two SAXParserFactory implements: one is JDK default implement com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl, the other one is from xerces: org.apache.xerces.jaxp.SAXParserFactoryImpl.

Here’s the problem, SAXParserFactory.newInstance() just selects only one implementation by specific order, as follows:

  • Use the javax.xml.parsers.SAXParserFactory system property.
  • UseUse the JAVA_HOME(the parent directory where jdk is installed)/lib/jaxp.properties for a property file that contains the name of the implementation class keyed on the same value as the system property defined above.
  • Use the Services API (as detailed in teh JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.parsers.SAXParserFactory in jars available to the runtime.
  • Platform default SAXParserFactory instance.

I tried to configure the different classnames in javax.xml.parsers.SAXParserFactory in different jar files. But it’s scope for whole classloader. In tomcat, all application libs are loaded in one classloader. For instance, the configure file in A.jar will overwrite the configure in B.jar, eventually all application gets the configure from A.jar.

So my question is how can I specific these two SAXParserFactory implementations in one web application? Thank you.

  • 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-06-10T08:25:27+00:00Added an answer on June 10, 2026 at 8:25 am

    Pretty sure you can’t (unless you use multiple classloaders). The code which depends on the other implementation should instantiate it directly (using the implementation class name).

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

Sidebar

Related Questions

I have a tomcat web application. It uses a couple of remote modules. One
I have a tomcat web application.Is it possible to create a folder / write
I have a web application running in a vanilla install of Tomcat 7 on
I have a web application made with Spring that runs on Tomcat. On the
I have an extremely simple web application running in Tomcat using Spring 3.0.2, Hibernate
I have a basic web application written in Java, running on a tomcat on
I have written a simple web Application which is running(on Tomcat Server) fine on
Let's say I have a Tomcat and a web application on it with index.html
I have two web applications that are running on a single Tomcat server and
I have two different web applications running on two different instances of tomcat. I

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.