[英]Ant: [xslt] java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.TraXLiaison
I have an Ant build which works fine on Windows, but seems to flake out when I bring it over to Linux. 我有一个Ant版本在Windows上可以正常工作,但是当我将它带到Linux时似乎已经崩溃了。 The issue is here:
问题在于:
[xslt]
java.lang.ClassNotFoundException
:org.apache.tools.ant.taskdefs.optional.TraXLiaison
[xslt]
java.lang.ClassNotFoundException
:org.apache.tools.ant.taskdefs.optional.TraXLiaison
I have already tried the following: 我已经尝试过以下方法:
xalan.jar
, xercesImpl.jar
and xml-apis.jar
in the $ANT_HOME/lib
directory. xalan.jar
, xercesImpl.jar
和xml-apis.jar
放在$ANT_HOME/lib
目录中。 I'm using an EC2 Linux instance (Basic 64-bit Amazon Linux AMI 2011.02.1 Beta (AMI Id: ami-8e1fece7) Amazon Linux AMI Base 2011.02.1, EBS boot, 64-bit architecture with Amazon EC2 AMI Tools.) 我正在使用EC2 Linux实例(基本的64位Amazon Linux AMI 2011.02.1 Beta(AMI Id:ami-8e1fece7)Amazon Linux AMI Base 2011.02.1,EBS启动,使用Amazon EC2 AMI工具的64位架构。)
The frustrating thing is that I DID have it working, and then when I packed everything up and moved it to another machine, BOTH machines stopped working. 令人沮丧的是,我让它工作,然后当我把所有东西打包并移动到另一台机器时,两台机器停止工作。 :(
:(
I was getting the same error from the junitreport
task: 我从
junitreport
任务得到了同样的错误:
build.xml:251: Errors while applying transformations:
java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.TraXLiaison
I had to install the ant-trax
RPM package to provide this class and fix the error: 我必须安装
ant-trax
RPM包来提供这个类并修复错误:
$ rpm -ql ant-trax | grep /usr/share/java/ant/ant-trax.jar
/usr/share/java/ant/ant-trax.jar
$ jar tf /usr/share/java/ant/ant-trax.jar | grep TraXLiaison
org/apache/tools/ant/taskdefs/optional/TraXLiaison.class
Assuming you're using Ant 1.8.1, it seems like you hit a bug, see = https://issues.apache.org/bugzilla/show_bug.cgi?id=49712 假设你正在使用Ant 1.8.1,看起来你遇到了一个bug,请参阅= https://issues.apache.org/bugzilla/show_bug.cgi?id=49712
The org.apache.tools.ant.taskdefs.optional.TraXLiaison Class has moved to ant-nodeps.jar, maybe you just have to put that jar on your path. org.apache.tools.ant.taskdefs.optional.TraXLiaison类已移至ant-nodeps.jar,也许您只需将该jar放在路径上即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.