Project

Profile

Help

Bug #5096

closed

.NET: FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found

Added by T Hata about 1 year ago. Updated 2 days ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
.NET API
Sprint/Milestone:
-
Start date:
2021-09-17
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
10
Fix Committed on Branch:
10
Fixed in Maintenance Release:
Platforms:
.NET

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();

Related issues

Related to Saxon - Bug #5306: Saxon 11.1 breaks my code (SAXParserFactory.newInstance() problem is back)ClosedNorm Tovey-Walsh2022-02-11

Actions
Actions #1

Updated by Michael Kay 11 months ago

This looks like a recurrence of bug #2305, though the dynamic loading failure might be for different reasons.

Actions #2

Updated by Michael Kay 8 months ago

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.

Actions #3

Updated by Michael Kay 8 months ago

  • Related to Bug #5306: Saxon 11.1 breaks my code (SAXParserFactory.newInstance() problem is back) added
Actions #4

Updated by Michael Kay 2 days ago

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.

Actions #5

Updated by Michael Kay 2 days ago

  • 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.

Please register to edit this issue

Also available in: Atom PDF