org.acegisecurity.AuthenticationCredentialsNotFoundException: VoterResource.authenticationNotFound: An Authentication object was n ot found in the SecurityContext

ICEsoft JIRA Issue Tracker | Ted Goddard | 9 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Acegi applies ThreadLocal security contexts (likely set in filters). When work is handed off to a thread in a thread pool, this context is not propagated. This needs to be addressed specifically for the acegi ThreadLocals. object was not found in the SecurityContext org.acegisecurity.AuthenticationCredentialsNotFoundException: VoterResource.authenticationNotFound: An Authentication object was n ot found in the SecurityContext at org.acegisecurity.vote.ResourceAccessBean.credentialsNotFound(ResourceAccessBean.java:181) at org.acegisecurity.vote.ResourceAccessBean.get(ResourceAccessBean.java:115) at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79) at org.springframework.faces.webflow.el.AbstractFlowExecutionPropertyResolver.getValue(AbstractFlowExecutionPropertyResolv er.java:77) at org.springframework.faces.webflow.el.WebFlowPropertyResolver.getValue(WebFlowPropertyResolver.java:70) at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141) at com.sun.el.parser.AstValue.getValue(AstValue.java:96) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183) at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56) at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:335) at com.icesoft.faces.component.paneltabset.PanelTab.isRendered(PanelTab.java:310) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.encodeEnd(PanelTabSetRenderer.java:368) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:362) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358) at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:196) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:532) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536) at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:286) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:154) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:151) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:293) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState$RenderRunner.run(PersistentFacesState.java:330) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668) at java.lang.Thread.run(Thread.java:534)

    ICEsoft JIRA Issue Tracker | 9 years ago | Ted Goddard
    org.acegisecurity.AuthenticationCredentialsNotFoundException: VoterResource.authenticationNotFound: An Authentication object was n ot found in the SecurityContext
  2. 0

    Acegi applies ThreadLocal security contexts (likely set in filters). When work is handed off to a thread in a thread pool, this context is not propagated. This needs to be addressed specifically for the acegi ThreadLocals. object was not found in the SecurityContext org.acegisecurity.AuthenticationCredentialsNotFoundException: VoterResource.authenticationNotFound: An Authentication object was n ot found in the SecurityContext at org.acegisecurity.vote.ResourceAccessBean.credentialsNotFound(ResourceAccessBean.java:181) at org.acegisecurity.vote.ResourceAccessBean.get(ResourceAccessBean.java:115) at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79) at org.springframework.faces.webflow.el.AbstractFlowExecutionPropertyResolver.getValue(AbstractFlowExecutionPropertyResolv er.java:77) at org.springframework.faces.webflow.el.WebFlowPropertyResolver.getValue(WebFlowPropertyResolver.java:70) at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141) at com.sun.el.parser.AstValue.getValue(AstValue.java:96) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183) at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56) at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:335) at com.icesoft.faces.component.paneltabset.PanelTab.isRendered(PanelTab.java:310) at com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.encodeEnd(PanelTabSetRenderer.java:368) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:362) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358) at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358) at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:196) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:532) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536) at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:286) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:154) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:151) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:293) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState$RenderRunner.run(PersistentFacesState.java:330) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668) at java.lang.Thread.run(Thread.java:534)

    ICEsoft JIRA Issue Tracker | 9 years ago | Ted Goddard
    org.acegisecurity.AuthenticationCredentialsNotFoundException: VoterResource.authenticationNotFound: An Authentication object was n ot found in the SecurityContext

    Root Cause Analysis

    1. org.acegisecurity.AuthenticationCredentialsNotFoundException

      VoterResource.authenticationNotFound: An Authentication object was n ot found in the SecurityContext

      at org.acegisecurity.vote.ResourceAccessBean.credentialsNotFound()
    2. Acegi Security Core
      ResourceAccessBean.get
      1. org.acegisecurity.vote.ResourceAccessBean.credentialsNotFound(ResourceAccessBean.java:181)
      2. org.acegisecurity.vote.ResourceAccessBean.get(ResourceAccessBean.java:115)
      2 frames
    3. JSF
      PropertyResolverImpl.getValue
      1. com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)
      1 frame
    4. org.springframework.faces
      WebFlowPropertyResolver.getValue
      1. org.springframework.faces.webflow.el.AbstractFlowExecutionPropertyResolver.getValue(AbstractFlowExecutionPropertyResolver.java:77)
      2. org.springframework.faces.webflow.el.WebFlowPropertyResolver.getValue(WebFlowPropertyResolver.java:70)
      2 frames
    5. Facelets
      LegacyELContext$LegacyELResolver.getValue
      1. com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
      1 frame
    6. EL
      ValueExpressionImpl.getValue
      1. com.sun.el.parser.AstValue.getValue(AstValue.java:96)
      2. com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183)
      2 frames
    7. Facelets
      LegacyValueBinding.getValue
      1. com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
      2. com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
      2 frames
    8. JavaEE 7
      UIComponentBase.isRendered
      1. javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:335)
      1 frame
    9. com.icesoft.faces
      PanelTabSetRenderer.encodeEnd
      1. com.icesoft.faces.component.paneltabset.PanelTab.isRendered(PanelTab.java:310)
      2. com.icesoft.faces.component.paneltabset.PanelTabSetRenderer.encodeEnd(PanelTabSetRenderer.java:368)
      2 frames
    10. JavaEE 7
      UIComponentBase.encodeEnd
      1. javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740)
      1 frame
    11. com.icesoft.faces
      GridRenderer.encodeChildren
      1. com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:362)
      2. com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358)
      3. com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:358)
      4. com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:196)
      4 frames
    12. JavaEE 7
      UIComponentBase.encodeChildren
      1. javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721)
      1 frame
    13. com.icesoft.faces
      D2DViewHandler.renderView
      1. com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:532)
      2. com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536)
      3. com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536)
      4. com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:536)
      5. com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:286)
      6. com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:154)
      6 frames
    14. JSF
      LifecycleImpl.render
      1. com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
      2. com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
      3. com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
      3 frames
    15. com.icesoft.faces
      PersistentFacesState$RenderRunner.run
      1. com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:151)
      2. com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:293)
      3. com.icesoft.faces.webapp.xmlhttp.PersistentFacesState$RenderRunner.run(PersistentFacesState.java:330)
      3 frames
    16. Backport of JSR 166
      ThreadPoolExecutor$Worker.run
      1. edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
      2. edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
      2 frames
    17. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:534)
      1 frame