Project

Profile

Help

Bug #2306

closed

InvalidCastException: Unable to cast object of type org.apache.xml.resolver.tools.CatalogResolver

Added by O'Neil Delpratt almost 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Category:
.NET API
Sprint/Milestone:
Start date:
2015-02-02
Due date:
% Done:

100%

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

Description

Bug issue reported from https://saxonica.plan.io/boards/3/topics/5992:

Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'org.apache.xml.resolver.tools.CatalogResolver' to type 'net.sf.saxon.dotnet.DotNetURIResolver'.
   at Saxon.Api.Processor.get_XmlResolver()
   at Saxon.Api.Processor.NewDocumentBuilder()
   at ConsoleApplication1.Program.Main(String[] args)

The assumption here is that a user supplies an .NET XMLResolver on the Processor property. If not supplied the default is to use the Java URIResolver. This causes the class exception to be thrown.

There are two possible ways to solve this bug. The first option is to return null if the URIResolver is not an instance of the .NET URIResolver. The second option is to return the default XMLResolver created in the .NET Processor class.


Related issues

Related to Saxon - Bug #2486: Using -catalog with .NET command lineClosedO'Neil Delpratt2015-10-25

Actions

Please register to edit this issue

Also available in: Atom PDF