title: Can't configure antMatchers after anyRequest? how to resolve
body: <pre><code>Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.IllegalStateException: Can't configure antMatchers after anyRequest
  at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  ... 22 common frames omitted
  </code></pre>
  <p>Caused by: java.lang.IllegalStateException: Can't configure antMatchers after anyRequest</p>
  <pre><code>@Configuration
  @EnableOAuth2Security
  public class SecurityConfig extends WebSecurityConfigurerAdapter {
  
      private static final String[] STATIC_RESOURCES = {
              &quot;/api/test-api&quot;
      };
  
      @Override
      public void configure(HttpSecurity http) throws Exception {
          // @formatter:off
          http.authorizeRequests().antMatchers(STATIC_RESOURCES).permitAll()
                  .anyRequest().authenticated();
          // @formatter:on
      }
  }
  </code></pre>