Project

Profile

Help

Bug #5306

closed

Saxon 11.1 breaks my code (SAXParserFactory.newInstance() problem is back)

Added by Gerben Abbink almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Low
Category:
Internals
Sprint/Milestone:
-
Start date:
2022-02-11
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

In Configuration.init() a CatalogResourceResolver is created:

commonResolver = new CatalogResourceResolver();

This leads to

SAXParserFactory.newIntance()

in org.xmlresolver.cache.ResourceCache, which looks at the global system property

"javax.xml.parsers.SAXParserFactory".

I have to use the global property for other parts in my source code (set to org.apache.xerces.jaxp.SAXParserFactoryImpl), and up to now Saxon was neglecting the property.

I thought JAXP and global properties are considered "evil"?

Any ideas how I can solve the problem?

Here is the stack:

InvocationTargetException Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found java.xml/javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:195) java.xml/javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:147) java.xml/javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:227) java.xml/javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:181) org.xmlresolver.cache.ResourceCache.(ResourceCache.java:189) org.xmlresolver.XMLResolverConfiguration.getFeature(XMLResolverConfiguration.java:971) org.xmlresolver.CatalogResolver.(CatalogResolver.java:51) org.xmlresolver.Resolver.(Resolver.java:63) net.sf.saxon.lib.CatalogResourceResolver.(CatalogResourceResolver.java:46) net.sf.saxon.Configuration.init(Configuration.java:366) net.sf.saxon.Configuration.(Configuration.java:229) java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)


Related issues

Related to Saxon - Bug #5096: .NET: FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not foundClosedMichael Kay2021-09-17

Actions

Please register to edit this issue

Also available in: Atom PDF