6

I have an Ant build which works fine on Windows, but seems to flake out when I bring it over to Linux. The issue is here:

[xslt] java.lang.ClassNotFoundException: org.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.
  2. Putting them into the classpath from within the build file
  3. Installing ant's optional classes.

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.)

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. :(

0

2 Answers 2

9

I was getting the same error from the junitreport task:

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:

$ 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
Sign up to request clarification or add additional context in comments.

Comments

4

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

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.

2 Comments

It's actually 1.8.2, but I tried specifically adding ant-nodeps.jar anyway. No dice. Thanks, though!
It definitely seems like a bug; I was able to solve the problem by creating a Java task that does it and putting the required jars into the classpath that way. Thanks!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.