Bug 200118

Summary: xalan-j2 -> XSLT Error (java.lang.NoClassDefFoundError): org.apache.xalan.templates.ElemValueOf
Product: [Fedora] Fedora Reporter: Caolan McNamara <caolanm>
Component: xalan-j2Assignee: Archit Shah <archit.shah>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: aph, fitzsim
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-26 19:06:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
sample xsl none

Description Caolan McNamara 2006-07-25 16:09:42 UTC
Description of problem:

Version-Release number of selected component (if applicable):
xalan-j2-2.7.0-4jpp_2fc

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):
org.apache.xalan.templates.ElemValueOf
Exception in thread "main" java.lang.RuntimeException:
org.apache.xalan.templates.ElemValueOf
   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 16:09:42 UTC
Created attachment 133000 [details]
sample xsl

Comment 2 Andrew Haley 2006-07-26 12:22:05 UTC
I'm not sure where exactly the real bug lies.

org.apache.xalan.templates.ElemValueOf.execute() uses
org.apache.xml.serializer.SerializationHandler:

  public void execute(TransformerImpl transformer) throws TransformerException
  {

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

but org.apache.xml.serializer.SerializationHandler is defined in
xalan-j2-serializer.jar

So I can run your command with

java -classpath
/usr/share/java/xalan-j2.jar:/usr/share/java/xalan-j2-serializer.jar
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 12:28:35 UTC
I've found refs to this breaking Ant on the web, e.g:

http://sipx-wiki.calivia.com/index.php/SipX_ConfigServer_Tips
<<
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 12:33:50 UTC
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 12:36:55 UTC
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 19:06:40 UTC
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.