java.lang.IllegalStateException: There was a problem retrieving the current GrailsWebRequest. This usually indicates a filter ordering issue (the 'springSecurityFilterChain' filter-mapping element must be positioned after the 'grailsWebRequest' element when using @Secured annotations).

GitHub | Igglybuff | 4 months ago
  1. 0

    GitHub comment 251#165470385

    GitHub | 12 months ago | virtualdogbert
    java.lang.IllegalStateException: There was a problem retrieving the current GrailsWebRequest. This usually indicates a filter ordering issue (the 'springSecurityFilterChain' filter-mapping element must be positioned after the 'grailsWebRequest' element when using @Secured annotations).
  2. 0

    Video player doesn't load or play movies

    GitHub | 4 months ago | Igglybuff
    java.lang.IllegalStateException: There was a problem retrieving the current GrailsWebRequest. This usually indicates a filter ordering issue (the 'springSecurityFilterChain' filter-mapping element must be positioned after the 'grailsWebRequest' element when using @Secured annotations).
  3. 0

    Filter order incorrect: .IllegalStateException: There was a problem retrieving the current GrailsWebRequest

    GitHub | 10 months ago | jblamber
    java.lang.IllegalStateException: There was a problem retrieving the current GrailsWebRequest. This usually indicates a filter ordering issue (the 'springSecurityFilterChain' filter-mapping element must be positioned after the 'grailsWebRequest' element when using @Secured annotations).
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I try to write a unit test for a controller in Spring MVC, involving Spring Security. For isolation purpose, I need to mock the service present in a Rest controller. To do this, I use this piece of code: {code:java} @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = EasyCook.class) @WebIntegrationTest public class RecipesControllerCan { @Mock private RecipesService recipesService; @InjectMocks private RecipesController controller; @Autowired private WebApplicationContext wac; @Before public void startMocks(){ controller = wac.getBean(RecipesController.class); MockMvc mockMvc = MockMvcBuilders .standaloneSetup(controller) .alwaysDo(print()) .apply(SecurityMockMvcConfigurers.springSecurity()) .build(); MockitoAnnotations.initMocks(this); } @Test public void testMe(){ } } {code} This leads to this result: java.lang.IllegalStateException: springSecurityFilterChain cannot be null. Ensure a Bean with the name springSecurityFilterChain implementing Filter is present or inject the Filter to be used. at org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurer.beforeMockMvcCreated(SecurityMockMvcConfigurer.java:62) at org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder.build(AbstractMockMvcBuilder.java:133) at fr.easycompany.easycook.springboot.controllers.RecipesControllerCan.startMocks(RecipesControllerCan.java:51) For more details, I joined the project simplified as much as possible to reproduce the issue.

    Spring JIRA | 12 months ago | RĂ©mi Doolaeghe
    java.lang.IllegalStateException: springSecurityFilterChain cannot be null. Ensure a Bean with the name springSecurityFilterChain implementing Filter is present or inject the Filter to be used.
  6. 0

    SEC-3174: Combine Spring Security Test and MockMVC throws IllegalStateException

    GitHub | 12 months ago | spring-issuemaster
    java.lang.IllegalStateException: springSecurityFilterChain cannot be null. Ensure a Bean with the name springSecurityFilterChain implementing Filter is present or inject the Filter to be used.

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      There was a problem retrieving the current GrailsWebRequest. This usually indicates a filter ordering issue (the 'springSecurityFilterChain' filter-mapping element must be positioned after the 'grailsWebRequest' element when using @Secured annotations).

      at grails.plugin.springsecurity.web.access.intercept.AnnotationFilterInvocationDefinition.determineUrl()
    2. grails.plugin.springsecurity
      AbstractFilterInvocationDefinition.getAttributes
      1. grails.plugin.springsecurity.web.access.intercept.AnnotationFilterInvocationDefinition.determineUrl(AnnotationFilterInvocationDefinition.groovy:90)
      2. grails.plugin.springsecurity.web.access.intercept.AbstractFilterInvocationDefinition.getAttributes(AbstractFilterInvocationDefinition.groovy:72)
      2 frames
    3. spring-security-core
      AbstractSecurityInterceptor.beforeInvocation
      1. org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:196)
      1 frame
    4. Spring Security
      FilterChainProxy$VirtualFilterChain.doFilter
      1. org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:123)
      2. org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
      3. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      4. org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
      5. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      5 frames
    5. grails.plugin.springsecurity
      GrailsAnonymousAuthenticationFilter.doFilter
      1. grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.groovy:53)
      1 frame
    6. Spring Security
      FilterChainProxy$VirtualFilterChain.doFilter
      1. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      2. org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:149)
      3. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      4. org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
      5. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      5 frames