Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: "remember me" requires refresh?

  1. #11
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Good

    Like I said though, if you're still early on in development you should try and upgrade 'cos SecureContextUtils, SecureContextImpl etc. don't exist anymore. Probably better not to lock yourself into an outdated syntax if you don't need to.

  2. #12

    Default

    hehehehe... an excellent suggestion! =)

  3. #13

    Default

    first off, I am still using v. 0.8.2 and I need to keep that for now.

    When i switched from using request.getSession().getAttribute("ACEGI_SECURITY_ CONTEXT") to using SecureContextUtils.getSecureContext() it did fix the problem of "remember me requires refresh". However, I am now getting an exception when I hit some pages. It doesnt seem to affect anything (everything seems to work), but I'd like to figure out what is going on.

    Code:
    java.lang.IllegalStateException: ContextHolder invalid: 'null': are your filters ordered correctly? HttpSessionContextIntegrationFilter should have already executed by this time (look for it in the stack dump below)
    [full stack trace below]

    My filter chain looks like this:

    Code:
    	<bean id="filterChainProxy"
    		class="net.sf.acegisecurity.util.FilterChainProxy">
    		<property name="filterInvocationDefinitionSource">
    			<value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    				PATTERN_TYPE_APACHE_ANT
    				/**=HttpSessionContextFilter,AuthenticationProcessingFilter,rememberMeProcessingFilter,SecurityEnforcementFilter
    			</value>
    		</property>
    	</bean>
    So it should be hitting the HttpSessionContextFilter first. Why would SecureContextUtils.getSecureContext() be throwing that exception (only on certain pages, repeatable) when I call it to get the Context?

    Heres' the full stack trace...

    Code:
    13&#58;43&#58;37,781 ERROR &#91;localhost&#93;&#58;373 - Exception Processing ErrorPage&#91;errorCode=404, location=/pageHandler.htm&#93;
    java.lang.IllegalStateException&#58; ContextHolder invalid&#58; 'null'&#58; are your filters ordered correctly? HttpSessionContextIntegrationFilter should have already executed by this time &#40;look for it in the stack dump below&#41;
    	at net.sf.acegisecurity.context.security.SecureContextUtils.getSecureContext&#40;SecureContextUtils.java&#58;38&#41;
    	at tv.current.web.studio.security.SecurityHelper.getCurrentUsername&#40;SecurityHelper.java&#58;39&#41;
    	at org.apache.jsp.WEB_002dINF.jsp.site.studioPageHandler_jsp._jspService&#40;org.apache.jsp.WEB_002dINF.jsp.site.studioPageHandler_jsp&#58;95&#41;
    	at org.apache.jasper.runtime.HttpJspBase.service&#40;HttpJspBase.java&#58;97&#41;
    	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;802&#41;
    	at org.apache.jasper.servlet.JspServletWrapper.service&#40;JspServletWrapper.java&#58;322&#41;
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile&#40;JspServlet.java&#58;291&#41;
    	at org.apache.jasper.servlet.JspServlet.service&#40;JspServlet.java&#58;241&#41;
    	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;802&#41;
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter&#40;ApplicationFilterChain.java&#58;252&#41;
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter&#40;ApplicationFilterChain.java&#58;173&#41;
    	at org.apache.catalina.core.ApplicationDispatcher.invoke&#40;ApplicationDispatcher.java&#58;672&#41;
    	at org.apache.catalina.core.ApplicationDispatcher.processRequest&#40;ApplicationDispatcher.java&#58;465&#41;
    	at org.apache.catalina.core.ApplicationDispatcher.doForward&#40;ApplicationDispatcher.java&#58;398&#41;
    	at org.apache.catalina.core.ApplicationDispatcher.forward&#40;ApplicationDispatcher.java&#58;301&#41;
    	at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel&#40;InternalResourceView.java&#58;97&#41;
    	at org.springframework.web.servlet.view.AbstractView.render&#40;AbstractView.java&#58;250&#41;
    	at org.springframework.web.servlet.DispatcherServlet.render&#40;DispatcherServlet.java&#58;928&#41;
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch&#40;DispatcherServlet.java&#58;705&#41;
    	at org.springframework.web.servlet.DispatcherServlet.doService&#40;DispatcherServlet.java&#58;625&#41;
    	at org.springframework.web.servlet.FrameworkServlet.serviceWrapper&#40;FrameworkServlet.java&#58;386&#41;
    	at org.springframework.web.servlet.FrameworkServlet.doGet&#40;FrameworkServlet.java&#58;346&#41;
    	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;689&#41;
    	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;802&#41;
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter&#40;ApplicationFilterChain.java&#58;252&#41;
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter&#40;ApplicationFilterChain.java&#58;173&#41;
    	at org.apache.catalina.core.ApplicationDispatcher.invoke&#40;ApplicationDispatcher.java&#58;672&#41;
    	at org.apache.catalina.core.ApplicationDispatcher.processRequest&#40;ApplicationDispatcher.java&#58;465&#41;
    	at org.apache.catalina.core.ApplicationDispatcher.doForward&#40;ApplicationDispatcher.java&#58;398&#41;
    	at org.apache.catalina.core.ApplicationDispatcher.forward&#40;ApplicationDispatcher.java&#58;301&#41;
    	at org.apache.catalina.core.StandardHostValve.custom&#40;StandardHostValve.java&#58;362&#41;
    	at org.apache.catalina.core.StandardHostValve.status&#40;StandardHostValve.java&#58;283&#41;
    	at org.apache.catalina.core.StandardHostValve.invoke&#40;StandardHostValve.java&#58;136&#41;
    	at org.apache.catalina.valves.ErrorReportValve.invoke&#40;ErrorReportValve.java&#58;105&#41;
    	at org.apache.catalina.core.StandardEngineValve.invoke&#40;StandardEngineValve.java&#58;107&#41;
    	at org.apache.catalina.connector.CoyoteAdapter.service&#40;CoyoteAdapter.java&#58;148&#41;
    	at org.apache.coyote.http11.Http11Processor.process&#40;Http11Processor.java&#58;856&#41;
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection&#40;Http11Protocol.java&#58;744&#41;
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket&#40;PoolTcpEndpoint.java&#58;527&#41;
    	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt&#40;LeaderFollowerWorkerThread.java&#58;80&#41;
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run&#40;ThreadPool.java&#58;684&#41;
    	at java.lang.Thread.run&#40;Unknown Source&#41;

  4. #14
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Well, it should be "HttpSessionContextIntegrationFilter" for a start.

    There aren't any acegi filters in this stack trace. It's going straight from the container doFilter method into the JSP-specific stuff. Are you sure you're applying the filters properly in your web.xml?

Similar Threads

  1. Refresh PropertyPlaceholder data at runtime
    By rebornspirt in forum Container
    Replies: 2
    Last Post: Oct 28th, 2004, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •