【问题标题】:ant xmlbean task behavior differs from Oracle HotSpot to IBM J9ant xmlbean 任务行为从 Oracle HotSpot 到 IBM J9 不同
【发布时间】:2015-05-07 19:40:09
【问题描述】:

我的 ant xmlbean 任务在 HotSpot 1.8 下运行良好,但在 IBM J9 下失败,异常 IO Error java.nio.charset.UnmappableCharacterException: Input length = 1

我该如何解决这个问题?

这是我的蚂蚁任务:

<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 文件包含德语变音符号(ä、ü 等字母)。我尝试将文件保存为 UTF-8 和 iso-8859-1,但结果是一样的。

【问题讨论】:

    标签: java ant jvm-hotspot j9


    【解决方案1】:

    好吧,如果我使用-Dfile.encoding=... 提供正确的文件编码,它就可以工作。我仍然不明白为什么没有这个选项它不适用于变音符号但适用于俄语字母,但无论如何...... 为 Ant 指定此选项的最佳方法是使用 ANT_OPTS 环境变量。

    【讨论】:

      猜你喜欢
      • 2011-05-28
      • 2012-08-09
      • 1970-01-01
      • 2011-03-31
      • 1970-01-01
      • 2011-06-06
      • 1970-01-01
      • 2015-07-31
      • 1970-01-01
      相关资源
      最近更新 更多