简体   繁体   English

Ant:[xslt] java.lang.ClassNotFoundException:org.apache.tools.ant.taskdefs.optional.TraXLiaison

[英]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.ClassNotFoundExceptionorg.apache.tools.ant.taskdefs.optional.TraXLiaison

I have already tried the following: 我已经尝试过以下方法:

  1. Putting xalan.jar , xercesImpl.jar and xml-apis.jar in the $ANT_HOME/lib directory. xalan.jarxercesImpl.jarxml-apis.jar放在$ANT_HOME/lib目录中。
  2. Putting them into the classpath from within the build file 将它们放入构建文件中的类路径中
  3. Installing ant's optional classes. 安装ant的可选类。

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.

相关问题 如何修复Java lang.ClassNotFoundException:org.apache.tools.ant.taskdefs.Execute - How to fix java lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.Execute Apache Ant:java.lang.ClassNotFoundException: - Apache Ant: java.lang.ClassNotFoundException: 如何为ant安装org.apache.tools.ant.taskdefs.optional.Rpm - How to install org.apache.tools.ant.taskdefs.optional.Rpm for ant 找不到taskdef类org.apache.tools.ant.taskdefs.optional.junit.JUnitTask - taskdef class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be found 原因:找不到类org.apache.tools.ant.taskdefs.optional.XMLValidateTask - Cause: the class org.apache.tools.ant.taskdefs.optional.XMLValidateTask was not found 带有ant + Junit的java.lang.classnotfoundexception - java.lang.classnotfoundexception with ant + Junit Ant和Junit测试java.lang.ClassNotFoundException - Ant and Junit test java.lang.ClassNotFoundException 带有Ant的JUnit,另一个java.lang.ClassNotFoundException - JUnit with Ant, another java.lang.ClassNotFoundException 带有ant的junit的java.lang.classnotfoundexception - java.lang.classnotfoundexception for junit with ant Spring,Tomcat 6和ANT Build Scripts:java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener - Spring, Tomcat 6, and ANT Build Scripts: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM