You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by "Lensch, Thomas" <Le...@juris.de> on 2009/05/05 11:18:37 UTC

XSLTC java.lang.NoSuchMethodError

Hi,

running the following class:

	public static void main(String[] args) throws
TransformerException, IOException
	{
		String xmlUrl = "D:\\XSL-Test\\data.xml";
		String xslUrl =
"D:\\Entwicklung\\workspace\\portalprodukte\\src\\webapp\\WEB-INF\\xsl\\
document_content\\identity.xsl";

		
		System.out.println( "JVM:\t" +
System.getProperty("java.vm.vendor") +
             "---- " + System.getProperty("java.vm.version") +
             " (" + System.getProperty("java.vm.name") + ")");
		System.out.println( "JVM mode:\t" +
System.getProperty("java.vm.info"));
		System.out.println( "Architecture:\t" +
System.getProperty("os.arch"));
		System.out.println( "OS:\t" +
System.getProperty("os.name"));
		System.out.println( "OS Version:\t" +
System.getProperty("os.version"));
		System.out.println( "Xalan version:\t" +
             org.apache.xalan.Version.getVersion());


		
		
	
System.out.println(System.setProperty("javax.xml.transform.TransformerFa
ctory",
	
"org.apache.xalan.xsltc.trax.TransformerFactoryImpl"));
		
		TransformerFactory tFactory =
TransformerFactory.newInstance();

		tFactory.setAttribute("debug", Boolean.TRUE);
		tFactory.setAttribute("package-name",
"de.juris.portal.linkresolve.servlet.translet");
		tFactory.setAttribute("auto-translet", Boolean.TRUE);
		tFactory.setAttribute("use-classpath", Boolean.FALSE);

		Transformer tranformer = tFactory.newTransformer(new
StreamSource(xslUrl));

		ByteArrayOutputStream bout = new
ByteArrayOutputStream();
		tranformer.transform(new StreamSource(xmlUrl), new
StreamResult(bout));

		FileOutputStream fout = new
FileOutputStream(System.getProperty("user.dir"));
		fout.write(bout.toByteArray());
		fout.close();
	}

Leads to the following output:

JVM:	Sun Microsystems Inc.---- 10.0-b23 (Java HotSpot(TM) Client VM)
JVM mode:	mixed mode, sharing
Architecture:	x86
OS:	Windows XP
OS Version:	5.1
Xalan version:	Xalan Java 2.7.1
null
Umsetzung mit Translet
'de.juris.portal.linkresolve.servlet.translet.identity' 
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.xml.dtm.ref.sax2dtm.SAX2DTM.<init>(Lorg/apache/xml/dtm/DTMMan
ager;Ljavax/xml/transform/Source;ILorg/apache/xml/dtm/DTMWSFilter;Lorg/a
pache/xml/utils/XMLStringFactory;ZIZZ)V
	at
org.apache.xml.dtm.ref.sax2dtm.SAX2DTM2.<init>(SAX2DTM2.java:1868)
	at org.apache.xalan.xsltc.dom.SAXImpl.<init>(SAXImpl.java:729)
	at
org.apache.xalan.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:3
53)
	at
org.apache.xalan.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:2
30)
	at
org.apache.xalan.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:
464)
	at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.ja
va:632)
	at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.ja
va:303)
	at de.juris.portal.linkresolve.servlet.xsltc.main(xsltc.java:64)

Identity.xsl just copies input to output.

What is the problem? Some kind of configuration problem.

Furthermore i wonder where to find the class file of compiled xsl. I
will need it for caching purposes.

Best regards,
Thomas