Bug #5096
closed
.NET: FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
Fix Committed on Branch:
10
Fixed in Maintenance Release:
Description
I'm upgrading Saxon .NET 9.9.1.8 to 10.6. Now, setting the catalog file throws an exception.
Unhandled Exception: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl, saxon-ee-10.6, Version=10.6, Culture=neutral, PublicKeyToken=e1fdd002d5083fe6 not found
Sample code:
System.Uri catalog = new System.Uri( @"c:\test\catalog.xml" );
Saxon.Api.Processor processor = new Saxon.Api.Processor();
processor.SchemaManager.Catalog = catalog.ToString();
This looks like a recurrence of bug #2305, though the dynamic loading failure might be for different reasons.
I suspect the problem might be the change from four-part to two-part version numbers. For the dynamic loading, we need to give the version number of the DLL as .NET understands it, which is probably 10.6.0.1 or similar, rather than 10.6. In DotNetPlatform.setDefaultSAXParserFactory
we're picking up the version number using Version.getProductVersion()
, which gives us the two-part version number.
- Related to Bug #5306: Saxon 11.1 breaks my code (SAXParserFactory.newInstance() problem is back) added
I'm not able to reproduce the problem, which makes it difficult to test a fix.
However, the code introduced by bug #2305 is still present in DotNetPlatform line 496:
System.setProperty("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl, saxon-"+editionCode+"-"+ Version.getProductVersion() +", Version="+ Version.getProductVersion()+", Culture=neutral, PublicKeyToken=e1fdd002d5083fe6");
and this produces the string "Version=10.8" (on the current build), whereas the actual assembly version is 10.8.0.0.
I'm therefore going to take a punt on this and append ".0.0" to the version number in this line of code, and hope that the problem goes away.
- Category set to .NET API
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Applies to branch 10 added
- Fix Committed on Branch 10 added
- Platforms .NET added
Closing this in the hope that the version number mismatch is the actual issue.
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.9 added
Bug fix applied in the Saxon 10.9 maintenance release.
Please register to edit this issue
Also available in: Atom
PDF