Search code examples
javaantjvm-hotspotj9

ant xmlbean task behavior differs from Oracle HotSpot to IBM J9


I have ant xmlbean task that works fine under HotSpot 1.8 but fails under IBM J9 with exception IO Error java.nio.charset.UnmappableCharacterException: Input length = 1

How may I fix that?

Here is my ant task:

<target name="gen">
 <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="cpth" />
 <xmlbean destfile="./ttt.jar"
          classpathref="cpth">
      <fileset dir="C:\projects\whatever" includes="1.xsd 2.xsd conf.xsdconfig"/>
 </xmlbean>
</target>

XSD files contains German umlauts (letters like ä, ü). I try to save files in UTF-8 and iso-8859-1, but the result is the same.


Solution

  • Well, it works if I provide correct file encoding using -Dfile.encoding=.... I still don't understand why without this option it is doesn't work with umlauts but works with Russian letters, but anyway... Best way to specify this option for Ant is using ANT_OPTS environment variable.