Skip to main content

Xalan classes go missing once Java is upgraded from 1.4 to 1.5

We found a bit of a strange problem today at work - some Xalan classes seemed to have disappeared. This week we upgraded some of our Tomcat web servers from Java 1.4 to Java 1.5. Everything appeared to work seamlessly, but today we noticed that one section of one site failed with a 'ClassNotFoundException'.

It was complaining about a couple of Xalan classes. We cracked open the rt.jar file ($JAVA_HOME/jre/lib/rt.jar) of 1.4 to see what used to be there. Lo and behold the Xalan classes were there right in the middle of rt.jar.

We then moved over to our new 1.5 install and cracked open it's rt.jar. This time the Xalan classes were hidden out of the way with a 'com.sun' prefix to every class. Obviously Sun don't want you using their shipped version of Xalan...

We decided that the best thing to do was to download a proper Xalan distro and put that in the application's WEB-INF/lib directory.

We downloaded xalan-j_2_7_0-bin.tar.gz from the UK mirror of Xalan's binaries and extracted xalan.jar & serializer.jar to be copied to our web server.

After a Tomcat restart our problem was solved!

Technorati Tags: , ,