struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Adams <>
Subject Re: Struts2 threading in a Java EE application server environment
Date Tue, 19 Oct 2010 03:58:31 GMT
Specifically, the thread context information placed on the original
thread by the servlet container that provides the J2EE name associated
with the webapp and component, etc.   This information is (as far as I
know) specific to the servlet container implementation and is not
portable in any way, so I would be surprised if struts2 was able to
copy it from the original thread to the new thread in any reliable

In the webapp that has this problem, I see this in the web.xml:


Does the StrutsPrepareAndExecuteFilter, in fact, create a new thread
on which it invokes the action's "execute()" method?
It certainly seems that way, as here is a partial stacktrace on which
the action class is invoked:
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

On Mon, Oct 18, 2010 at 10:40 PM, Dave Newton <> wrote:
> What information is missing?
> Dave
> On Mon, Oct 18, 2010 at 11:34 PM, Phil Adams <> wrote:
>> Hi,
>> I'm trying to help a customer that is using Struts2 within a Java
>> EE-compliant application server.  Unfortunately, I have no real
>> experience with Struts2 so I was hoping someone on this mailing list
>> could offer some help.
>> The main issue that I'm dealing with is this...   An HTTP request is
>> received by the app server's servlet container and struts2 is invoking an
>> action class's "execute()" method, but it appears to be doing this on
>> a "new" thread (i.e. a thread other than the servlet container's
>> "worker" thread).
>> First of all, is this normal and expected?   If so, is it controllable
>> by the user via some sort of configuration?      Also, how does the
>> struts2 framework deal with thread context information?
>> Specifically, when creating new threads in a Java EE environment, the
>> thread context information needs to be copied from the original thread
>> to the new thread, otherwise various Java EE components will have
>> unpredictable results.
>> Thanks in advance for any help!
>> --
>> Phil Adams
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Phil Adams
Cedar Park, TX

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message