You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by everett stauffer <ev...@chem.ucsd.edu> on 2000/07/16 04:46:09 UTC

Problem using Xalan in JSP

Hello-

  I'm using Tomcat 3.1 on Win NT 4.0, with JDK 1.3, and Xalan 1.1.

The following JSP snippet gives me an error that I just can't seem 
to work around in a useful way.

<%
//ss.process(new XSLTInputSource(new FileReader(xf)),
//           new XSLTResultTarget(out));
proc.process(new XSLTInputSource(new FileReader(xf)),
             new XSLTInputSource(new FileReader(xsl)),
             new XSLTResultTarget(out));
%>

As you can see, I've commented out my 'preferred' code, and stuck
to the 'brute force' call, and neither work.

The error returned in the page, which corresponds to the above call is:
java.lang.IllegalStateException: Response has already been committed
        at
org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java:157)
        at
org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299)
        at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
        at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
        at
org.apache.tomcat.service.TcpWorkerThread.run(PoolTcpEndpoint.java:366)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:411)
        at java.lang.Thread.run(Unknown Source)

I can use "out.println(someString)" just fine to output strings to show that
the error does indeed occur when process is called.

I've also setup a wrapper Thread class to run the process in.  This doesn't 
produce an error, but it also doesn't produce any output.  I'm sure this is
because the page has closed the response before the XSL processor returns.

I've also been using this code, the xml file and the xslt sheet without any
problems from a straight java command line program.

I'd appreciate any and all help.  TIA.


Everett