title: Cannot instantiate interface org.springframework.context.ApplicationListener after adding spring-security-oauth2
body: <p>After I added <code>spring-security-oauth2</code> to my pom.xml:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.security.oauth&lt;/groupId&gt;
      &lt;artifactId&gt;spring-security-oauth2&lt;/artifactId&gt;
      &lt;version&gt;2.2.0.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>I started to get </p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.context.logging.ClasspathLoggingApplicationListener
      at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439)
      at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:418)
      at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:409)
      at org.springframework.boot.SpringApplication.&lt;init&gt;(SpringApplication.java:268)
      at org.springframework.boot.SpringApplication.&lt;init&gt;(SpringApplication.java:247)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)
  </code></pre>
  
  <p>after running my <code>@SpringBootApplication</code>. Please note that I am using Spring Boot 2.0.0.M5 and I think that this might be the root of the problem (w.r.t. versions).</p>
  
  <p>This is the entire pom.xml I'm using:;</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;artifactId&gt;server&lt;/artifactId&gt;
          &lt;groupId&gt;mahlzeit&lt;/groupId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;artifactId&gt;api&lt;/artifactId&gt;
  
      &lt;properties&gt;
          &lt;spring.boot.version&gt;2.0.0.M5&lt;/spring.boot.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
  
          &lt;!-- Spring Framework Boot --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.boot.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
              &lt;version&gt;${spring.boot.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
              &lt;version&gt;${spring.boot.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;version&gt;${spring.boot.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring Framework --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-jwt&lt;/artifactId&gt;
              &lt;version&gt;1.0.8.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security.oauth&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-oauth2&lt;/artifactId&gt;
              &lt;version&gt;2.2.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;version&gt;9.4.1208-jdbc42-atlassian-hosted&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.jayway.jsonpath&lt;/groupId&gt;
              &lt;artifactId&gt;json-path&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;repositories&gt;
          &lt;!-- Required since this is currently using Spring RC version --&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-milestones&lt;/id&gt;
              &lt;name&gt;Spring Milestones&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/libs-milestone&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>I have the suspicion this might have to do with conflicting versions - most answers on stackoverflow turn out to be just that - but I cannot make out the actual issue I am having here.</p>
  
  <hr>
  
  <p>The <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-M5-Release-Notes" rel="noreferrer">release notes</a> for Spring Boot 2.0.0.M5 state:</p>
  
  <blockquote>
    <p><strong>OAuth 2.0 Support</strong><br/><br/>
    Functionality from the Spring Security OAuth project is being migrated to core Spring Security. OAuth 2.0 client support has already been added and additional features will be migrated in due course.<br/><br/>
    If you depend on Spring Security OAuth features that have not yet been migrated you will need to add <code>org.springframework.security.oauth:spring-security-oauth2</code> and configure things manually. If you only need OAuth 2.0 client support you can use the auto-configuration provided by Spring Boot 2.0. We’re also continuing to support Spring Boot 1.5 so older applications can continue to use that until an upgrade path is provided.</p>
  </blockquote>