Project

Profile

Help

Bug #5809

closed

NPE on failure to load user-supplied collation class

Added by Radu Coravu almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2023-01-13
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
Java

Description

Cannot attach the samples as they were provided by an end user. As a general description, the XSLT stylesheet refers to a collation:

<xsl:sort select="tst:getDictionaryForm(.)" collation="http://saxon.sf.net/collation?class=abc.MyCollation" />

and Saxon cannot find the collation:

java.lang.ClassNotFoundException: abc.MyCollation
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at net.sf.saxon.trans.DynamicLoader.getClass(DynamicLoader.java:113)
	at net.sf.saxon.trans.DynamicLoader.getInstance(DynamicLoader.java:181)
	at net.sf.saxon.Configuration.getInstance(Configuration.java:782)
	at net.sf.saxon.java.JavaCollationFactory.makeCollation(JavaCollationFactory.java:61)
	at net.sf.saxon.java.JavaPlatform.makeCollation(JavaPlatform.java:404)
	at net.sf.saxon.lib.StandardCollationURIResolver.resolve(StandardCollationURIResolver.java:83)
	at net.sf.saxon.Configuration.getCollation(Configuration.java:1662)
	at net.sf.saxon.Configuration.getCollation(Configuration.java:1687)
	at net.sf.saxon.style.StyleElement.findCollation(StyleElement.java:1257)
	at net.sf.saxon.style.XSLSortOrMergeKey.validate(XSLSortOrMergeKey.java:88)
	at net.sf.saxon.style.XSLSort.validate(XSLSort.java:23)
	at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1823)
	at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1856)
	at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1827)
	at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1856)
	at net.sf.saxon.style.LiteralResultElement.validateChildren(LiteralResultElement.java:293)
	at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1827)
	at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1856)
	at net.sf.saxon.style.LiteralResultElement.validateChildren(LiteralResultElement.java:293)
	at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1827)
	at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1856)
	at net.sf.saxon.style.LiteralResultElement.validateChildren(LiteralResultElement.java:293)
	at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1827)
	at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1856)

so it attempts to create an XML processing incident without error code, which fails with a null assertion:

java.lang.NullPointerException: null
	at java.util.Objects.requireNonNull(Objects.java:203)
	at net.sf.saxon.trans.XmlProcessingIncident.<init>(XmlProcessingIncident.java:54)
	at net.sf.saxon.style.StyleElement.compileError(StyleElement.java:2475)
	at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1825)
	at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1856)

Please register to edit this issue

Also available in: Atom PDF