struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Holguin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4134) MessageStoreInterceptor java.lang.IllegalStateException if there is no session
Date Fri, 23 Oct 2015 18:53:27 GMT

    [ https://issues.apache.org/jira/browse/WW-4134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14971617#comment-14971617
] 

Raymond Holguin commented on WW-4134:
-------------------------------------

I am still experiencing this issue.  I am currently running version 2.3.24.1, perhaps this
was reintroduced after 2.3.16?  I was using an older version bit I upgraded specifically to
handle this issue, but it appears its still here.

I reproduce this issue with the same scenario.  Init server startup, no sessions currently
open.  I am using the pre-built defaultStack except I am adding the store interceptor at the
top.

Please let me know what additional information you need.

{code:xml}
<action name="instructions" class="controller.student.Instructions">
			<interceptor-ref name="defaultStack" />
			
			<result type="redirectAction">editAppContact</result>
		</action>
{code}

{code:xml}
<interceptor-stack name="defaultStack">
             	<interceptor-ref name="store">
		        	<param name="operationMode">AUTOMATIC</param>
		    	</interceptor-ref>
		    	
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="servletConfig"/>
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="chain"/>
                <interceptor-ref name="scopedModelDriven"/>
                <interceptor-ref name="modelDriven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="datetime"/>
                <interceptor-ref name="multiselect"/>
                <interceptor-ref name="staticParams"/>
                <interceptor-ref name="actionMappingParams"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="debugging"/>
                <interceptor-ref name="deprecation"/>
            </interceptor-stack>
{code}

{code}
java.lang.IllegalStateException: Cannot create a session after the response has been committed
	at org.apache.catalina.connector.Request.doGetSession(Request.java:2377)
	at org.apache.catalina.connector.Request.getSession(Request.java:2097)
	at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
	at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
	at org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:182)
	at org.apache.struts2.interceptor.MessageStoreInterceptor.after(MessageStoreInterceptor.java:297)
	at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:198)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
	at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
	at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
	at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:662)

{code}

> MessageStoreInterceptor java.lang.IllegalStateException if there is no session
> ------------------------------------------------------------------------------
>
>                 Key: WW-4134
>                 URL: https://issues.apache.org/jira/browse/WW-4134
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.3.14.3
>            Reporter: Jan Čustović
>             Fix For: 2.3.16
>
>
> When there is no session the following error happens on {code:xml}<result type="redirect">{code}.
> {code}
> [org.apache.struts2.dispatcher.Dispatcher.error:38] []  - Exception occurred during processing
request: Cannot create a session after the response has been committed
> java.lang.IllegalStateException: Cannot create a session after the response has been
committed
>         at org.apache.catalina.connector.Request.doGetSession(Request.java:2880) ~[catalina.jar:7.0.37]
>         at org.apache.catalina.connector.Request.getSession(Request.java:2315) ~[catalina.jar:7.0.37]
>         at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:898)
~[catalina.jar:7.0.37]
>         at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229)
~[servlet-api.jar:na]
>         at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229)
~[servlet-api.jar:na]
>         at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229)
~[servlet-api.jar:na]
>         at org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:177) ~[struts2-core-2.3.14.3.jar:2.3.14.3]
>         at org.apache.struts2.interceptor.MessageStoreInterceptor.after(MessageStoreInterceptor.java:279)
~[struts2-core-2.3.14.3.jar:2.3.14.3]
>         at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:195)
~[struts2-core-2.3.14.3.jar:2.3.14.3]
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
~[xwork-core-2.3.14.3.jar:2.3.14.3]
> {code}
> This always happens if you wget your resource that has redirect.
> The interceptor should check if the session is available and only then perform message
storing.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message