tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nazir Faisal-LFN003 <Faisal.Na...@invisix.com>
Subject Need help! :( (XALAN CONFIG )
Date Wed, 14 Feb 2001 15:23:46 GMT
Hello

We are trying to configure Tomcat to work with Xalan (the XSLT engine).
We have set up the servlet (XSLT.class) in the webapps directory ie 
D:\tomcat\webapps\faisal\WEB-INF\Classes\XSLT.class 

we have also configured the 'web.xml' in 
D:\tomcat\webapps\faisal\WEB-INF

this file looks like :

------------- web.xml ----------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
    <servlet>
      <servlet-name>
         XSLT
      </servlet-name>
      <servlet-class>
         XSLT
      </servlet-class>
    </servlet>
</web-app>

-------------eof web.xml ------------------

We can run simple example servlets however, when using the
XALAN API, we keep getting the following errors:

----------------tomcat.log------------------

Context log: path="/examples" Adding context path="/examples"  docBase="webapps/examples"
Context log: path="" Adding context path=""  docBase="webapps/ROOT"
Context log: path="/test" Adding context path="/test"  docBase="webapps/test"
Context log: path="/faisal" Adding context path="/faisal"  docBase="webapps/faisal"

Starting tomcat. Check logs/tomcat.log for error messages

Starting tomcat install="d:\tomcat" home="D:\tomcat" 

classPath="d:\tomcat\classes;d:\tomcat\lib\webserver.jar;
d:\tomcat\lib\jasper.jar;d:\tomcat\lib\xml.jar;
d:\tomcat\lib\servlet.jar;c:\jdk1.3\lib\tools.jar;
D:\tomcat\lib\servlet.jar;D:\xalan\stylebook-1.0-b3_xalan-2.jar;.;
D:\xalan\xalan.jar;D:\xalan\xerces.jar;D:\xalan\xalanj1compat.jar;
D:\xalan\xalan2jdoc.jar;D:\xalan\xalanservlet.jar"

Context log: path="/admin" Automatic context load docBase="D:\tomcat\webapps\admin"
Context log: path="/admin" Adding context path="/admin"  docBase="D:\tomcat\webapps\admin"

file:///D:/tomcat/webapps/faisal/fruit.xml; Line 3; Column 3; java.lang.NoSuchMethodError
  at org.apache.xpath.DOM2Helper.getLocalNameOfNode(DOM2Helper.java:326)   
	at org.apache.xalan.templates.TemplateList.getHead(TemplateList.java:471)
  at org.apache.xalan.templates.TemplateList.getTemplate(TemplateList.java:528)
  at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:432)
  at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
  at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2154)
  at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2097)
  at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2029)
  at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1189)
  at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)
  at java.lang.Thread.run(Thread.java:484)

-----------------eof tomcat.log----------------------

The servlet compiles ok and the all the Xalan jars are placed in the correct directories,
however, there seems to be a problem with Tomcat finding the above Xalan API method call.

We've tried doing many things already and are urgently needing some help.

Here's the simple servlet that we've been working on :

------------------------------------------------XSLT.java----------------------------------------
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import javax.xml.transform.*;
import javax.xml.transform.stream.*;
import org.w3c.dom.*;


public class XSLT extends HttpServlet {
	public void init(){
		TransformerFactory trFactory = TransformerFactory.newInstance();
		File xmlFile = new File("birds.xml");
		File xslFile = new File("birds.xsl");
		try
		{
		  Transformer transformer = trFactory.newTransformer(new StreamSource(xslFile));
		  transformer.transform(new StreamSource(xmlFile), new StreamResult(new File("result.out")))
		}
		catch (Exception et)
		{
		  System.out.print(String.valueOf(et));
		}
	}
}

------------------------------------------------eof XSLT.java----------------------------------------

 <<Nazir Faisal-LFN003.vcf>> 

Mime
View raw message