Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Thread is not of type weblogic.kernel.ExecuteThread"

1 view
Skip to first unread message

Barry

unread,
Oct 23, 2001, 10:27:41 PM10/23/01
to

My servlet makes use of a class that extends Thread, and when I try to use the
servlet under WLS, I get a
ClassCastException "Thread is not of type weblogic.kernel.ExecuteThread". It
sounds like WLS wants my thread to
extend/implement this class, but 1) How can I deploy my web app to any servlet
container if it uses a
WebLogic-specific class, and 2) Where is this class?

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

Dimitri Rakitine

unread,
Oct 23, 2001, 10:37:37 PM10/23/01
to
What do you do on that thread and what is the exception stacktrace ?

Barry <barr...@yahoo.com> wrote:

> Barry


--
Dimitri

Barry

unread,
Oct 24, 2001, 5:27:33 PM10/24/01
to

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)

Dimitri Rakitine

unread,
Oct 24, 2001, 7:17:29 PM10/24/01
to
You are not supposed to use servletresponse object outside of the
servlet's service() method or on the other thread. Why do you need
to run XSL transformation on a different thread ?

Barry <barr...@yahoo.com> wrote:

> Dimitri,


--
Dimitri

Barry

unread,
Oct 25, 2001, 3:22:11 AM10/25/01
to

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

Dimitri Rakitine

unread,
Oct 25, 2001, 5:04:14 AM10/25/01
to
From the Servlet spec:

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

unread,
Oct 26, 2001, 4:16:01 AM10/26/01
to

Ok, thanks very much for your help.

Barry

0 new messages