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 RE: Need help! :( (XALAN CONFIG )
Date Wed, 14 Feb 2001 15:44:28 GMT

hi

thanks for all help, we just been looking at the archives
and it would appear the we posted an already well known problem.
Thanks for the quick response people, we really appreciate all help

rob & fazza




-----Original Message-----
From: Samson, Lyndon [IT] [mailto:lyndon.samson@ssmb.com]
Sent: 14 February 2001 15:33
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Need help! :( (XALAN CONFIG )


Hi

This question comes up alot on this list. The fix is to put your xml parser
before the tomcat one in the CLASSPATH. ie xalan.jar;xerces.jar;xml.jar
This will avoid the less functional classes in xml.jar being used when you
really want the newer classes. You can make the change in tomcat.[sh|bat]
for tomcat <4.0 In 4.0 I think the WEB-INF/lib is 
automatcally searched b4 the system classpath, so no problems like this.


If you want more detail search the list archive.

-----Original Message-----
From: Nazir Faisal-LFN003 [mailto:Faisal.Nazir@invisix.com]
Sent: Wednesday, February 14, 2001 3:24 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: Need help! :( (XALAN CONFIG )


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.ja
va:432)
  at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:193)
  at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2154)
  at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2097)
  at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2029)
  at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava: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>> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message