title: BearerTokenAccessDeniedHandler Class Definition Not found
body: <p>I'm trying a demo project with spring boot 2.1.1 and spring sec 5, as an OAuth2 resource server however when I try to run the following</p>
  
  <p><strong>ENV</strong></p>
  
  <ul>
  <li>Spring Boot 2.1.1 RELEASE</li>
  <li><p>Spring Security Core 5.1.2</p></li>
  <li><p>Java 8 </p></li>
  </ul>
  
  <p><strong>CODE</strong></p>
  
  <pre><code>    @RestController
      @SpringBootApplication
     //  @EnableResourceServer
      public class MyApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(MyApplication.class, args);
      }
      @GetMapping("/hello")
      public String sayHello() {
      return "Hello World";
      }
  
      @Configuration
      static class MyWebSecurityConfigurerAdapter extends 
      WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http
                  .authorizeRequests().anyRequest().authenticated()
                  .and()
                  .oauth2ResourceServer().jwt(); // &lt;--- throws error
  
          }
        }
  
      }
  </code></pre>
  
  <p>Which throws the error</p>
  
  <blockquote>
    <p>Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/oauth2/server/resource/web/access/BearerTokenAccessDeniedHandler</p>
  </blockquote>
  
  <p><strong>BUILD</strong></p>
  
  <p>My dependencies look like</p>
  
  <pre><code>dependencies {
  
  implementation('org.springframework.boot:spring-boot-starter-web')
  implementation('org.springframework.boot:spring-boot-starter-security')
  implementation(group: 'org.springframework.security.oauth.boot', name: 'spring-security-oauth2-autoconfigure', version: '2.1.1.RELEASE')
  
  implementation(group: 'org.springframework.security.oauth', name: 'spring-security-oauth2', version: '2.3.4.RELEASE')
  }
  </code></pre>