Tuesday, January 30, 2007

Ant problem: no class def SerializerTrace

I've started on a new project at work, where existing work has been done by colleagues doing Java development on Windows. Since I want to stick to my Linux environment, I'm trying to use the existing build scripts on Linux. The ant script works fine under Windows, but when I try to run the Ant xslt task on my FC5 machine (or RHEL 4, same thing happens), I get:

build.xml:74: The following error occurred while executing this line:
java.lang.NoClassDefFoundError: org/apache/xml/serializer/SerializerTrace

Now my Ant is installed via JPackage, and has all of its dependencies up-to-date. Double check, and, yup, xalan is installed and should provide all of the dependencies for the xslt Ant task. Google for answers, and it seems that there has been a packaging change in xalan 2.7, thereby confusing Ant (ants do have very small brains). This wiki page from the SipX project gives the necessary clue and recipe. Ant needs to be told to look for xalan-j2-serializer.jar, which can be achieved by dropping a file into /etc/ant.d. I'm not entirely clear what /etc/ant.d is doing, but this works for me:

root@rowan-8 ~
# cd /etc/ant.d

root@rowan-8 /etc/ant.d
# echo xalan-j2-serializer.jar > xslt

It doesn't matter what the file is called, it just needs to have the jar name in it. Presumably at some point the dependency issue will get sorted out cleanly. In the meantime, that's another minor but irritating roadblock out of the way.

7 Comments:

Blogger Sanjay said...

Thanks, that helps!!

19 June, 2008 21:19  
Anonymous Anonymous said...

Thanks!!

08 August, 2008 15:17  
Anonymous Anonymous said...

Likewise! This helped a bunch.

13 August, 2008 20:34  
Anonymous Anonymous said...

Thanks, that helped! Funny that this hasn't been fixed yet :)

26 January, 2009 10:21  
Anonymous Anonymous said...

Thanks! Still broken, but now good

13 March, 2009 19:42  
Blogger Nic said...

Thanks from me too, this still seems to be broken

06 June, 2009 12:29  
Blogger yntze said...

Thanks, this answer helps a lot!!

26 June, 2009 23:24  

Post a Comment

<< Home