If anyone has encountered this or knows anything about it, I'd sure appreciate
some advice. The same web app
runs fine under Tomcat.
Barry
Barry <barr...@yahoo.com> wrote:
> Barry
--
Dimitri
The thread applies an XSLT transformation to XML generated by
the servlet, writing the transformed XML document as the servlet's
response. The stack trace is as follows:
java.lang.ClassCastException: test.XSLTransformer - Thread is not of type weblogic.kernel.ExecuteThread.
at weblogic.servlet.internal.ResponseHeaders.setDateHeader(ResponseHeaders.java:280)
at weblogic.servlet.internal.ServletResponseImpl.setDateHeader(ServletResponseImpl.java:549)
at weblogic.servlet.internal.ServletResponseImpl.writeHeaders(ServletResponseImpl.java:770)
at weblogic.servlet.internal.ServletOutputStreamImpl.sendHeaders(ServletOutputStreamImpl.java:220)
at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:111)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:245)
at java.io.BufferedWriter.flush(BufferedWriter.java:233)
at com.icl.saxon.output.XMLEmitter.endDocument(XMLEmitter.java:142)
at com.icl.saxon.output.ProxyEmitter.endDocument(ProxyEmitter.java:70)
at com.icl.saxon.output.HTMLIndenter.endDocument(HTMLIndenter.java:192)
at com.icl.saxon.output.ProxyEmitter.endDocument(ProxyEmitter.java:70)
at com.icl.saxon.output.Outputter.close(Outputter.java:702)
at com.icl.saxon.Controller.resetOutputDestination(Controller.java:383)
at com.icl.saxon.Controller.transformDocument(Controller.java:986)
at com.icl.saxon.Controller.transform(Controller.java:907)
at test.XSLTransformer.transform(XSLTransformer.java:210)
at test.XSLTransformer.run(XSLTransformer.java:92)
Barry <barr...@yahoo.com> wrote:
> Dimitri,
--
Dimitri
I use a thread to do the transformation to avoid having to write
everything to a file and then read it back in. The transformation
thread is consuming the XML data as it is generated.
I can not find the restrictions you mentioned in the servlet
specification or in a book on servlets I have. Are these
restrictions specific to WebLogic? It works fine on Tomcat,
which is the reference implemenation.
Thanks,
Barry
SRV.2.3.3.3 Thread Safety
Implementations of the request and response objects are not guaranteed
to be thread safe. This means that they should only be used within the
scope of the request handling thread.
References to the request and response objects must not be given to objects
executing in other threads as the resulting behavior may be nondeterministic.
Anyway, creating new threads (especially new thread per request) should be
avoided unless it is absolutely nesessary. For example, you can look into
using filters (http://e-docs.bea.com/wls/docs61/webapp/filters.html) to
transform XML generated by your servlet(s).
Barry <barr...@yahoo.com> wrote:
> Dimitri,
> Thanks,
> Barry
--
Dimitri
Barry