Project

Profile

Help

Bug #4305

java.lang.ClassCastException on .NET (in German Locale) when Transform.exe attempts to output memory usage

Added by Martin Honnen over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Command Line
Sprint/Milestone:
-
Start date:
2019-08-29
Due date:
% Done:

100%

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

Description

Trying to test my Saxon EE license with 9.9.1.4 .NET I have run into a problem, it seems the Transform.exe is causing a java.lang.ClassCastException while trying to output the memory usage:

PS C:\SomePath\SomeDir> & 'C:\Program Files\Saxonica\SaxonEE9.9N\bin\Transform.exe' -t -xsl:.\identity.xsl -s:.\input.xml
Saxon-EE 9.9.1.4N from Saxonica
.NET 4.0.30319.42000 on Microsoft Windows NT 6.2.9200.0
Using license serial number V.....
URIResolver.resolve href="file:/C:/SomePath/SomeDir/./identity.xsl" base="null"
Using parser org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
Stylesheet compilation time: 656.2711ms
Processing file:/C:/SomePath/SomeDir/./input.xml
Building tree for file:///C:/SomePath/SomeDir/input.xml using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 12.6563ms
Tree size: 14 nodes, 2 characters, 0 attributes
<?xml version="1.0" encoding="UTF-8"?><root>
...
</root>Execution time: 135.3115ms
java.lang.ClassCastException: Das Objekt des Typs "java.util.PropertyResourceBundle" kann nicht in Typ "sun.util.resources.OpenListResourceBundle" umgewandelt werden.
        at sun.util.resources.LocaleData.getCurrencyNames(LocaleData.java:84)
        at sun.util.locale.provider.LocaleResources.getCurrencyName(LocaleResources.java:216)
        at sun.util.locale.provider.CurrencyNameProviderImpl.getString(CurrencyNameProviderImpl.java:122)
        at sun.util.locale.provider.CurrencyNameProviderImpl.getSymbol(CurrencyNameProviderImpl.java:90)
        at java.util.Currency$CurrencyNameGetter.getObject(Currency.java:647)
        at java.util.Currency$CurrencyNameGetter.getObject(Currency.java:625)
        at sun.util.locale.provider.LocaleServiceProviderPool.getLocalizedObjectImpl(LocaleServiceProviderPool.java:307)
        at sun.util.locale.provider.LocaleServiceProviderPool.getLocalizedObject(LocaleServiceProviderPool.java:265)
        at java.util.Currency.getSymbol(Currency.java:505)
        at java.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:648)
        at java.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:114)
        at sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(DecimalFormatSymbolsProviderImpl.java:85)
        at java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:181)
        at java.util.Formatter.getZero(Formatter.java:2284)
        at java.util.Formatter.<init>(Formatter.java:1892)
        at java.util.Formatter.<init>(Formatter.java:1915)
        at java.lang.StringHelper.format(StringHelper.java:2537)
        at net.sf.saxon.Transform.processFile(Transform.java:1298)
        at net.sf.saxon.Transform.doTransform(Transform.java:815)
        at cli.Saxon.Cmd.DotNetTransform.Main(Unknown Source)
Fatal error during transformation: java.lang.ClassCastException: Das Objekt des Typs "java.util.PropertyResourceBundle" kann nicht in Typ "sun.util.resources.OpenListResourceBundle" umgewandelt werden.

In the same window with the same arguments and settings Saxon-EE 9.8.0.12N runs fine and manages to output the memory usage just fine.

It seems the problem occurs also with HE .NET 9.1.1.3:

Saxon-HE 9.9.1.3N from Saxonica
.NET 4.0.30319.42000 on Microsoft Windows NT 6.2.9200.0
-- snipped -- Execution time: 123.9636ms
java.lang.ClassCastException: Das Objekt des Typs "java.util.PropertyResourceBundle" kann nicht in Typ "sun.util.resources.OpenListResourceBundle" umgewandelt werden.
        at sun.util.resources.LocaleData.getCurrencyNames(LocaleData.java:84)
        at sun.util.locale.provider.LocaleResources.getCurrencyName(LocaleResources.java:216)
        at sun.util.locale.provider.CurrencyNameProviderImpl.getString(CurrencyNameProviderImpl.java:122)
        at sun.util.locale.provider.CurrencyNameProviderImpl.getSymbol(CurrencyNameProviderImpl.java:90)
        at java.util.Currency$CurrencyNameGetter.getObject(Currency.java:647)
        at java.util.Currency$CurrencyNameGetter.getObject(Currency.java:625)
        at sun.util.locale.provider.LocaleServiceProviderPool.getLocalizedObjectImpl(LocaleServiceProviderPool.java:307)
        at sun.util.locale.provider.LocaleServiceProviderPool.getLocalizedObject(LocaleServiceProviderPool.java:265)
        at java.util.Currency.getSymbol(Currency.java:505)
        at java.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:648)
        at java.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:114)
        at sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(DecimalFormatSymbolsProviderImpl.java:85)
        at java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:181)
        at java.util.Formatter.getZero(Formatter.java:2284)
        at java.util.Formatter.<init>(Formatter.java:1892)
        at java.util.Formatter.<init>(Formatter.java:1915)
        at java.lang.StringHelper.format(StringHelper.java:2537)
        at net.sf.saxon.Transform.processFile(Transform.java:1288)
        at net.sf.saxon.Transform.doTransform(Transform.java:805)
        at cli.Saxon.Cmd.DotNetTransform.Main(Unknown Source)
Fatal error during transformation: java.lang.ClassCastException: Das Objekt des Typs "java.util.PropertyResourceBundle" kann nicht in Typ "sun.util.resources.OpenListResourceBundle" umgewandelt werden.

History

#1 Updated by Michael Kay over 2 years ago

  • Status changed from New to In Progress

This seems to be essentially the same problem as bug #4247 - calls on String.format() with a non-English locale rely on sun.util.locale localisation classes which are not present in the OpenJDK library used by IKVM.

Our only option, it seems, is not to use String.format(). Fortunately there are very few places where it is used.

#2 Updated by Michael Kay over 2 years ago

  • Status changed from In Progress to Resolved
  • Assignee set to Michael Kay
  • Applies to branch trunk added
  • Fix Committed on Branch 9.9, trunk added

I have rewritten the code in the few places where String.format() was used (in one case, using String.format() with a null Locale as first argument, which gives Locale-independent formatting)

#3 Updated by Michael Kay over 2 years ago

  • Subject changed from java.lang.ClassCastException when using Saxon 9.9.1.4 or 9.9.1.3 .NET Transform.exe during its attempt to output memory usage to java.lang.ClassCastException on .NET (in German Locale) when Transform.exe attempts to output memory usage

#4 Updated by O'Neil Delpratt over 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.9.1.5 added

Bug fix applied in the Saxon 9.9.1.5 maintenance release.

Please register to edit this issue

Also available in: Atom PDF