Bug 200118 - xalan-j2 -> XSLT Error (java.lang.NoClassDefFoundError): org.apache.xalan.templates.ElemValueOf
xalan-j2 -> XSLT Error (java.lang.NoClassDefFoundError): org.apache.xalan.tem...
Product: Fedora
Classification: Fedora
Component: xalan-j2 (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Archit Shah
Depends On:
  Show dependency treegraph
Reported: 2006-07-25 12:09 EDT by Caolan McNamara
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-07-26 15:06:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
sample xsl (661 bytes, text/plain)
2006-07-25 12:09 EDT, Caolan McNamara
no flags Details

  None (edit)
Description Caolan McNamara 2006-07-25 12:09:42 EDT
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:
every time

Steps to Reproduce:
1. take the attached langfilter.xsl and run 
2. java -classpath /usr/share/java/xalan-j2.jar org.apache.xalan.xslt.Process
-XSL langfilter.xsl

Actual results:
(Location of error unknown)XSLT Error (java.lang.NoClassDefFoundError):
Exception in thread "main" java.lang.RuntimeException:
   at org.apache.xalan.xslt.Process.doExit(Process.java:1153)
   at org.apache.xalan.xslt.Process.main(Process.java:1126)

Expected results:
 You should get just 
 <?xml version="1.0" encoding="UTF-8?> on the output instead, which is what I
get with FC-5 xalan-j2-2.6.0-3jpp_9fc

Additional info:
This breaks the OpenOffice.org build
Comment 1 Caolan McNamara 2006-07-25 12:09:42 EDT
Created attachment 133000 [details]
sample xsl
Comment 2 Andrew Haley 2006-07-26 08:22:05 EDT
I'm not sure where exactly the real bug lies.

org.apache.xalan.templates.ElemValueOf.execute() uses

  public void execute(TransformerImpl transformer) throws TransformerException

    XPathContext xctxt = transformer.getXPathContext();
    SerializationHandler rth = transformer.getResultTreeHandler();

but org.apache.xml.serializer.SerializationHandler is defined in

So I can run your command with

java -classpath
org.apache.xalan.xslt.Process -XSL langfilter.xsl

The real mystery is why this didn't fail before.  Is the split of
xalan-j2-serializer and xalan-j2 recent?

I've also seen tis problem cause problems with ant, where
jaxp_transform_impl.jar also referes to a class in xalan-j2-serializer.jar
Comment 3 Andrew Haley 2006-07-26 08:28:35 EDT
I've found refs to this breaking Ant on the web, e.g:

For example after upgrading from xalan 2.6 to xalan 2.7 my Ant started
complaining about org/apache/xml/serializer/SerializerTrace class not being
found. Google search reveals that this class is now in new
xalan-j2-serializer.jar. To make ant load this jar you can do that following.

 echo "xalan-j2-serializer.jar" > sipxconfig
 sudo mv sipxconfig /etc/ant.d

Comment 4 Caolan McNamara 2006-07-26 08:33:50 EDT
yes, the split is new as of 2.7.0, but note that the META-INF/MANIFEST.MF of
xalan-j2.jar has

"Class-Path: xercesImpl.jar xml-apis.jar serializer.jar" 

so it looks like that xalan-j2-serializer.jar was intended to be called
serializer.jar and picked up through this mechanism. So perhaps fixing the
MANIFEST.MF to refer to the fedora names of these jars is the correct fix for
that problem

Actually as an aside, I did log a bug when 2.7.0 was initially released to
upgrade to it as early as possible in the rawhide cycle to flush out any
problems with the new separate serializer.jar early in the rawhide cycle :-)
Comment 5 Andrew Haley 2006-07-26 08:36:55 EDT
Ah, well caught!

Okay, so we need to link xalan-j2-serializer.jar to serializer.jar, then?  What
would be best?
Comment 6 Thomas Fitzsimmons 2006-07-26 15:06:40 EDT
From Vivek Lakshmanan:

xalan-j2-2.7.0-4jpp_4fc is now in dist-fc6-head. It contains a patch to replace
occurrences of serializer.jar in MANIFEST files to xalan-j2-serializer.jar.

xalan-j2-2.7.0-4jpp_4fc has been retagged into dist-fc6.

Note You need to log in before you can comment on or make changes to this bug.