Illegal state exception create session after response

[email protected]
Newsgroups gmane.comp.java.springframework.devel
Message-ID <OF01EAC42F.1A60F329-ON85257767.00685FB1-85257767.0068C332@LocalDomain>
This is probably something duh but please bare with me I am new...

I am trying to create a webservice that returns a UUID as a response my 
code looks as follows...

@RequestMapping(value="/getAuthUser.htm", method=RequestMethod.GET)
        @ResponseBody
        public String authenticateUserGet( ModelMap modelMap, 
 HttpServletRequest httpReq,
                                                                        
@RequestParam("custPermId") String custPermId,
                                                                        
@RequestParam("sessionKey") String sessKey)
         throws Exception {
                String sessionKey = sessKey;
                String customerPermId = custPermId;
                // If the user is coming from H.com with no sessionKey and 
custPermId forward them to Login page
                if (sessionKey == null || customerPermId == null){
                        return null;
                }
                userSession = populateClientDetails(httpReq, sessionKey);
                userSession.setCustomer( new Customer() );
                userSession.getCustomer().setCustPermId( customerPermId );
                userSession.setUuid(uuid());
                modelMap.addAttribute(AppConstants.USER_SESSION, 
userSession);
                String intelligentAuthenticationStatus = null; 
                return userSession.getUuid();
        }

However, after it returns the UUID I see the following in my error 
window,and when I look for the session added to the model map later I 
cannot find it.

java.lang.IllegalStateException: Cannot create a session after the 
response has been committed
        at org.apache.catalina.connector.Request.doGetSession(
Request.java:2381)
        at org.apache.catalina.connector.Request.getSession(
Request.java:2098)
        at org.apache.catalina.connector.RequestFacade.getSession(
RequestFacade.java:833)
        at 
org.springframework.web.context.request.ServletRequestAttributes.getSession(
ServletRequestAttributes.java:79)
        at 
org.springframework.web.context.request.ServletRequestAttributes.setAttribute(
ServletRequestAttributes.java:129)
        at 
org.springframework.web.bind.support.DefaultSessionAttributeStore.storeAttribute(
DefaultSessionAttributeStore.java:54)
        at 
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.updateModelAttributes(
HandlerMethodInvoker.java:206)
        at 
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(
AnnotationMethodHandlerAdapter.java:424)
        at 
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(
AnnotationMethodHandlerAdapter.java:409)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(
DispatcherServlet.java:771)
        at org.springframework.web.servlet.DispatcherServlet.doService(
DispatcherServlet.java:716)
        at 
org.springframework.web.servlet.FrameworkServlet.processRequest(
FrameworkServlet.java:644)
        at org.springframework.web.servlet.FrameworkServlet.doGet(
FrameworkServlet.java:549)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:290)
        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.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:852)
        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(Unknown Source)

Thanks in advance for any help

Jackie


This message and any attachments are for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.



- - - Huntington CAN-SPAM Opt-Out Auto-Disclosure - - -
If you prefer not to receive future e-mail offers for products or services from Huntington click or visit https://www.huntington.com/unsubscribe

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

_______________________________________________
Springframework-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/springframework-developer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.