Project

Profile

Help

Bug #5306

closed

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

Added by Gerben Abbink about 2 years ago. Updated about 2 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
Actions #1

Updated by Michael Kay about 2 years ago

  • Category set to Internals
  • Assignee set to Norm Tovey-Walsh
  • Applies to branch 11, trunk added

Sounds as if it would be a good idea if the CatalogResolver supplied an alternative way to instantiate an XML parser, as an alternative to the JAXP mechanism.

You can always set your own Configuration-level ResourceResolver that does nothing (always returns null) but I don't know if that would have unwanted side-effects.

Actions #2

Updated by Michael Kay about 2 years ago

Note there is a relationship to bug #5096, which is a failure to do dynamic loading of the SAX parser from the old catalog resolver in Saxon/.NET 10.6; which could also be solved by allowing the user to supply an XMLReader directly, rather than relying on the JAXP mechanism to get one.

Actions #3

Updated by Michael Kay about 2 years ago

  • Related to Bug #5096: .NET: FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found added
Actions #9

Updated by Norm Tovey-Walsh about 2 years ago

  • Status changed from New to Resolved
Actions #10

Updated by Norm Tovey-Walsh about 2 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 11.2 added

Please register to edit this issue

Also available in: Atom PDF