Bug #2306
closed
InvalidCastException: Unable to cast object of type org.apache.xml.resolver.tools.CatalogResolver
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
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.
- Status changed from New to Resolved
- % Done changed from 0 to 100
We have decided upon the second option, which is to return the default .NET XmlResolver.
Bug fixed and committed to subversion
- Status changed from Resolved to In Progress
I am reopening this bug because the fix is causing the Java products to fail with the following exception (note: pre-maintenance release):
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xml/resolver/tools/CatalogResolver
at net.sf.saxon.trans.DynamicLoader.registerKnownClasses(DynamicLoader.java:42)
at net.sf.saxon.trans.DynamicLoader.<init>(DynamicLoader.java:29)
at net.sf.saxon.Configuration.<init>(Configuration.java:142)
at com.saxonica.config.ProfessionalConfiguration.<init>(ProfessionalConfiguration.java:134)
at com.saxonica.config.EnterpriseConfiguration.<init>(EnterpriseConfiguration.java:103)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
- Status changed from In Progress to Resolved
The fix applied was to add processor directives to the code in the DynamicLoader class to make it DOTNET specific.
- Status changed from Resolved to Closed
- Fixed in version set to 9.6.0.5
Bug fix applied in the Saxon 9.6.0.5 maintenance release.
- Status changed from Closed to In Progress
- Status changed from In Progress to Resolved
A call on XmlResolver property is also possible in the XsltCompiler classt therefore the same fix as mentioned in comment #0 and #1 is required.
Bug has now been fixed and committed to subversion and will be available in the next maintenance release (i.e. 9.6.0.6). An nunit test case has been created to check for regression in future releases.
- Fixed in version deleted (
9.6.0.5)
- Status changed from Resolved to Closed
- Fixed in version set to 9.6.0.6
Bug fix applied in the Saxon 9.6.0.6 maintenance release.
- Related to Bug #2486: Using -catalog with .NET command line added
- Sprint/Milestone set to 9.6.0.6
- Applies to branch 9.6 added
- Fix Committed on Branch 9.6 added
- Fixed in Maintenance Release 9.6.0.6 added
Please register to edit this issue
Also available in: Atom
PDF