tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Geary <sabrew...@tri-lakesonline.net>
Subject Re: XSLT Transformations with Tomcat 3.2 Final and Xalan or XT?
Date Thu, 07 Dec 2000 04:55:42 GMT
Juan Ramirez wrote:

> Yes, I'm using it successfully now.  The problem you're seeing is
> because the xalan class files can't be found.  Look at your class path
> and make sure the xalan.jar is referenced somewhere.

It is.

>  If that doesn't
> work, sometimes, for some reason, I've had to unjar the classes for
> tomcat to find them.

I tried that with no success. Here's a more explicit description of what I'm
doing:

CLASSPATH:
.;F:/jdk1.3/lib/tools.jar;F:/jakarta-tomcat-3.2/lib/servlet.jar;F:/xalan-j_2_0_D

01/bin/xerces.jar;F:/xalan-j_2_0_D01/bin/xalan.jar;

I've tried many different variations of CLASSPATH; the one listed above is
the latest.

XslProcessorBean, which is called from a JSP custom tag, is listed below:

package beans.xsl;

import java.io.*;
import java.net.URL;
import javax.servlet.*;
import javax.servlet.http.*;

import org.xml.sax.InputSource;
import org.apache.trax.*;

public class XslProcessorBean implements Serializable {
 public XslProcessorBean() {}

 public void process(InputStream xmlstream,
         InputStream xslstream,
         HttpServletRequest req,
         HttpServletResponse res)
         throws IOException, ServletException {
  Processor processor = createProcessor();
  InputSource xmlSource = new InputSource(xmlstream),
        xslSource = new InputSource(xslstream);

  if(xmlSource != null && xslSource != null) {
   try {
    Templates templates = processor.process(xslSource);
    Transformer transformer = templates.newTransformer();
    transformer.transform(xmlSource, new Result(res.getWriter()));
   }
   catch(Exception ex) {
    throw new ServletException(ex);
   }
  }
 }
 private Processor createProcessor() throws ServletException {
  Processor processor = null;
  try {
   processor = Processor.newInstance("xslt");
  }
  catch(Exception ex) {
   throw new ServletException(ex);
  }
  return processor;
 }
}


This line (line 27; see below) results in the exception:
transformer.transform(xmlSource, new Result(res.getWriter()));


And here's the exception:

Location: /xslt/test.jsp
Internal Servlet Error:

javax.servlet.ServletException
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)

 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)

 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)

 at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)

Root cause:
java.lang.NoSuchMethodError
 at org.apache.xpath.DOM2Helper.getLocalNameOfNode(DOM2Helper.java:253)
 at org.apache.xalan.templates.TemplateList.getHead(TemplateList.java:416)
 at
org.apache.xalan.templates.TemplateList.getTemplate(TemplateList.java:470)
 at
org.apache.xalan.templates.StylesheetComposed.getWhiteSpaceInfo(StylesheetComposed.java:313)

 at org.apache.xalan.stree.Parent.appendChild(Parent.java:246)
 at org.apache.xalan.stree.DocumentImpl.appendChild(DocumentImpl.java:172)
 at org.apache.xalan.utils.DOMBuilder.append(DOMBuilder.java:175)
 at org.apache.xalan.utils.DOMBuilder.startElement(DOMBuilder.java:276)
 at
org.apache.xalan.stree.SourceTreeHandler.startElement(SourceTreeHandler.java:250)

 at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1371)
 at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:705)

 at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:989)

 at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:380)

 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:328)

 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:642)

 at beans.xsl.XslProcessorBean.process(beans/xsl/XslProcessorBean.java:27)
 at tags.xsl.XslApplyTag.doEndTag(tags/xsl/XslApplyTag.java:27)
 at
_0002ftest_0002ejsptest_jsp_1._jspService(_0002ftest_0002ejsptest_jsp_1.java:112)

 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)

 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)

 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)

 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)

 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)

 at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)




Mime
View raw message