struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kofford, C Todd" <tkoff...@ku.edu>
Subject RE: Struts 2 Portlet - Intermittent Session Problems
Date Thu, 16 Apr 2009 02:29:22 GMT
Well, my log didn't seem to expose the problem when compared to a log from my local machine
where the problem did not show itself, because except for the session = {} there was no difference.

However, I did run across this uportal-specific bug when researching the problem more.
http://www.ja-sig.org/issues/browse/UP-1816

It sounds like it is the exact same problem that I've been seeing. I'll test the patch tomorrow
and post the results (crossing fingers).

I know that this is a struts forum, but I wanted to make sure that I didn't leave this issue
hanging, just in case others using struts & uportal come across this issue.

Todd Kofford
tkofford@ku.edu
University of Kansas - IT

-----Original Message-----
From: Kofford, C Todd [mailto:tkofford@ku.edu]
Sent: Wed 4/15/2009 4:04 PM
To: Struts Users Mailing List
Subject: RE: Struts 2 Portlet - Intermittent Session Problems
 
OK, I've now got a log with a sequence of events that causes the problem (see below). However,
I'm still not sure that I can determine where the request(s) went wrong except for where session
= {}.

Any help would be appreciated. This one is driving me crazy.

--Todd

DEBUG [http-8090-Processor20] [localhost].[/Parking].[] Apr/15 14:58:17 - servletPath=/Permits,
pathInfo=null, queryString=null, name=null
DEBUG [http-8090-Processor20] [localhost].[/Parking].[] Apr/15 14:58:17 -  Path Based Include
DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 - Entering processAction
DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 - serviceAction
DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 - Creating action
proxy for name = permitHomeIdBox, namespace = /permits
DEBUG [http-8090-Processor20] xwork2.DefaultActionProxy.[] Apr/15 14:58:17 - Creating an DefaultActionProxy
for namespace /permits and action name permitHomeIdBox
DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 - intercept '/permits/permitHomeIdBox'
{ 
DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 - before Locale=en_US
DEBUG [http-8090-Processor20] interceptor.PrefixMethodInvocationUtil.[] Apr/15 14:58:17 -
cannot find method [prepareIdBox] in action [edu.ku.it.sdd.si.parking.permits.action.PermitsHome@7f2a19]
DEBUG [http-8090-Processor20] interceptor.PrefixMethodInvocationUtil.[] Apr/15 14:58:17 -
cannot find method [prepareDoIdBox] in action [edu.ku.it.sdd.si.parking.permits.action.PermitsHome@7f2a19]
DEBUG [http-8090-Processor20] impl.InstantiatingNullHandler.[] Apr/15 14:58:17 - Entering
nullPropertyValue [target=[edu.ku.it.sdd.si.parking.permits.action.PermitsHome@7f2a19, com.opensymphony.xwork2.DefaultTextProvider@178991],
property=id]
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - session = {isPortletApp=true,
parkingID=100080, struts.portlet.valueStackFromEventPhase=com.opensymphony.xwork2.ognl.OgnlValueStack@ba168e,
faculty=edu.ku.it.sdd.si.parking.model.FacultyRecord@1aac3f8}
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session (A48726E2C673AA84704CB021D1017827):
retrieveFromSession() called, retriving key: student
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session (A48726E2C673AA84704CB021D1017827):
retrieveFromSession() called, retriving key: faculty
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session (A48726E2C673AA84704CB021D1017827):
retrieveFromSession() called, retriving key: permitOrder
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session (A48726E2C673AA84704CB021D1017827):
retrieveFromSession() called, retriving key: isPortletApp
DEBUG [http-8090-Processor20] impl.InstantiatingNullHandler.[] Apr/15 14:58:17 - Entering
nullPropertyValue [target=[edu.ku.it.sdd.si.parking.permits.action.PermitsHome@7f2a19, com.opensymphony.xwork2.DefaultTextProvider@178991],
property=struts]
DEBUG [http-8090-Processor20] interceptor.FileUploadInterceptor.[] Apr/15 14:58:17 - Bypassing
/permits/permitHomeIdBox
DEBUG [http-8090-Processor20] interceptor.StaticParametersInterceptor.[] Apr/15 14:58:17 -
Setting static parameters {}
DEBUG [http-8090-Processor20] interceptor.ParametersInterceptor.[] Apr/15 14:58:17 - Setting
params NONE
DEBUG [http-8090-Processor20] interceptor.ParametersInterceptor.[] Apr/15 14:58:17 - Setting
params employeeid => [ 1359156 ] struts.portlet.action => [ /permits/permits/permitHomeIdBox
] struts.portlet.mode => [ view ] studentid => [  ] 
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - Property: employeeid
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - Class: edu.ku.it.sdd.si.parking.permits.action.PermitsHome
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - field-level type converter
for property [employeeid] = none found
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - global-level type converter
for property [employeeid] = none found
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - falling back to default
type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@2083d]
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - Property: studentid
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - Class: edu.ku.it.sdd.si.parking.permits.action.PermitsHome
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - field-level type converter
for property [studentid] = none found
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - global-level type converter
for property [studentid] = none found
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - falling back to default
type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@2083d]
DEBUG [http-8090-Processor20] validation.AnnotationValidationInterceptor.[] Apr/15 14:58:17
- Validating /permits/permitHomeIdBox with method idBox.
DEBUG [http-8090-Processor20] interceptor.DefaultWorkflowInterceptor.[] Apr/15 14:58:17 -
Invoking validate() on action edu.ku.it.sdd.si.parking.permits.action.PermitsHome@7f2a19
DEBUG [http-8090-Processor20] xwork2.DefaultActionInvocation.[] Apr/15 14:58:17 - Executing
action method = idBox
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session (A48726E2C673AA84704CB021D1017827):
resetSession() called
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session (A48726E2C673AA84704CB021D1017827):
removeFromSession() called, removing key: faculty
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session (A48726E2C673AA84704CB021D1017827):
saveToSession() called, saving key: faculty
DEBUG [http-8090-Processor20] result.PortletResult.[] Apr/15 14:58:17 - Executing result in
Event phase
DEBUG [http-8090-Processor20] result.PortletResult.[] Apr/15 14:58:17 - Setting event render
parameter: /permits/selectPermitInput.action
DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 - after Locale=en_US
DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 - intercept }

DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 - Leaving processAction
DEBUG [Thread-62] [localhost].[/Parking].[] Apr/15 14:58:18 - servletPath=/Permits, pathInfo=null,
queryString=null, name=null
DEBUG [Thread-62] [localhost].[/Parking].[] Apr/15 14:58:18 -  Path Based Include
DEBUG [Thread-62] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:18 - Entering render
DEBUG [Thread-62] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:18 - serviceAction
DEBUG [Thread-62] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:18 - Creating action proxy for
name = selectPermitInput, namespace = /permits
DEBUG [Thread-62] xwork2.DefaultActionProxy.[] Apr/15 14:58:18 - Creating an DefaultActionProxy
for namespace /permits and action name selectPermitInput
DEBUG [Thread-62] interceptor.PortletStateInterceptor.[] Apr/15 14:58:18 - Won't restore stack
from event phase since it's a proper PRG request
DEBUG [Thread-62] interceptor.I18nInterceptor.[] Apr/15 14:58:18 - intercept '/permits/selectPermitInput'
{ 
DEBUG [Thread-62] interceptor.I18nInterceptor.[] Apr/15 14:58:18 - before Locale=en_US
DEBUG [Thread-62] interceptor.PrefixMethodInvocationUtil.[] Apr/15 14:58:18 - cannot find
method [prepareInput] in action [edu.ku.it.sdd.si.parking.permits.action.SelectPermits@a4ffc6]
DEBUG [Thread-62] interceptor.PrefixMethodInvocationUtil.[] Apr/15 14:58:18 - cannot find
method [prepareDoInput] in action [edu.ku.it.sdd.si.parking.permits.action.SelectPermits@a4ffc6]
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - session = {}
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Session (A48726E2C673AA84704CB021D1017827):
retrieveFromSession() called, retriving key: student
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Session (A48726E2C673AA84704CB021D1017827):
retrieveFromSession() called, retriving key: faculty
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Session (A48726E2C673AA84704CB021D1017827):
retrieveFromSession() called, retriving key: permitOrder
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Session (A48726E2C673AA84704CB021D1017827):
retrieveFromSession() called, retriving key: isPortletApp
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - PARKING PERMITS
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Parking id: 0
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Date/time: 2009-04-15 14:58:18
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - 
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - java.lang.NullPointerException
	at edu.ku.it.sdd.si.parking.permits.service.PermitSelectionServiceImpl.getAllowedPermitsEmployee(PermitSelectionServiceImpl.java:73)
	at edu.ku.it.sdd.si.parking.permits.action.SelectPermits.prepare(SelectPermits.java:86)
	at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:134)
...



-----Original Message-----
From: Kofford, C Todd [mailto:tkofford@ku.edu] 
Sent: Wednesday, April 15, 2009 8:57 AM
To: Struts Users Mailing List
Subject: RE: Struts 2 Portlet - Intermittent Session Problems

I've been trying to reproduce the problem, but can't do it consistently. I've never seen it
when running on localhost only on our test server. I've also been cleaning up a lot of code,
and I'm still not ruling out a logic (code) error.

No I'm not calling session.clear(), when I remove objects from session, I specifically remove
the object that I put there in the first place, session.remove(key); Curious though, if I
did call session.clear(), would a new session be created on the next request, or would the
invalidated session persist?

I've put more thorough logging into the application in all areas that concern session and
have also added a session listener (HttpSessionListener) to log when sessions are created
and destroyed.

Todd Kofford
tkofford@ku.edu
University of Kansas - IT


-----Original Message-----
From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com] 
Sent: Wednesday, April 15, 2009 8:46 AM
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet - Intermittent Session Problems

It would be helpful if you tried it in a different container and
report your findings, and/or create a JIRA issue with a small sameple
application that can be used to reproduce the error.

Are you by any chance calling "clear()" on the session map? That would
invalidate the session.

Nils-H

On Wed, Apr 15, 2009 at 3:40 PM, Kofford, C Todd <tkofford@ku.edu> wrote:
> I'm using session scope (implements SessionAware).
>
> No, I haven't deployed to a different portlet container.
>
> Todd Kofford
> tkofford@ku.edu
> University of Kansas - IT
>
>
> -----Original Message-----
> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
> Sent: Wednesday, April 15, 2009 4:05 AM
> To: Struts Users Mailing List
> Subject: Re: Struts 2 Portlet - Intermittent Session Problems
>
> As long as you're using the portlet session, and not the
> APPLICATION_SCOPE session, the sessions shouldn't interfere. Which
> container are you running in? Have you tried deploying to a different
> portlet container?
>
> Nils-H
>
> On Tue, Apr 14, 2009 at 8:01 PM, Kofford, C Todd <tkofford@ku.edu> wrote:
>> Hi Nils,
>>
>> Well this issue cannot be reproduced on a consistent basis. I can do the same operation
4 times and 3 of the 4 times it works properly, but one time it doesn't and the session disappears.
It's very random.
>>
>> One thing that might be noteworthy is that I have 2 portlets defined for the same
web application. To clarify, I have one parking web application that handles both citations
and permit purchases. Citations and Permits are defined as two individual portlets in the
our portal, and both point to the same parking webapp.
>>
>> I don't know if this is an issue or not. As random as this error is, I'm wondering
if the some jars are getting loaded up twice by tomcat and randomly switching between two
copies (of the same jar) as the requests are processed.
>>
>> Also to note is that this problem does not happen when the application(s) are run
outside the portal (i.e. as standalone webapps).
>>
>> Todd Kofford
>> tkofford@ku.edu
>> University of Kansas - IT
>>
>>
>> -----Original Message-----
>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>> Sent: Friday, April 10, 2009 5:20 PM
>> To: Struts Users Mailing List
>> Subject: Re: Struts 2 Portlet - Intermittent Session Problems
>>
>> Hi!
>>
>> The PortletStateInterceptor does nothing special with the Session. It
>> certainly does not invalidate it or remove stuff that's already there.
>> The debug statement that you see is an indication that the portlet has
>> been executed in the event phase, and the result has been properly
>> configured with a redirectAction result. As a matter of fact, that log
>> statement indicates that the interceptor is bypassing it's normal
>> executing and does essentially nothing.
>>
>> Is this something you can reproduce consistently? In that case, do you
>> have a sample that you could attach to a JIRA issue? Without more
>> information, it's impossible to say what the problem could be (besides
>> a regular session timeout or something...)
>>
>> Nils-H
>>
>> On Fri, Apr 10, 2009 at 10:13 PM, Kofford, C Todd <tkofford@ku.edu> wrote:
>>> I have a struts 2 (version 2.1.6) portlet that I keep seeing
>>> intermittent problems with the session being wiped out. Each time this
>>> happens I see the following messages in the log:
>>>
>>> DEBUG [Thread-57] interceptor.PortletStateInterceptor.[] Apr/10 14:26:57
>>> - Won't restore stack from event phase since it's a proper PRG request
>>> ...
>>> DEBUG [Thread-57] PermitBaseAction.[] Apr/10 14:26:57 - session = {}
>>>
>>> I'm not sure what is going on here. In the event phase just prior to
>>> this render phase, my session is populated but then the "...proper RPG
>>> request"  happens and my session is gone. I'm assuming that the portlet
>>> plugin gets into an invalid/mixed up state. But what would cause this?
>>>
>>> Any help would be appreciated.
>>>
>>> Todd Kofford
>>> tkofford@ku.edu
>>> University of Kansas - IT
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message