title: Runtime error while running a Spring Session + Spring Boot application
body: <p>I am trying to run this <a href="https://github.com/spring-projects/spring-session/archive/1.0.0.RELEASE.zip" rel="nofollow">Spring Session example available here</a> but, I've used Maven instead of Gradle. I get the following error both while a) Running the WAR file and b) Deploying the WAR in an WildFly8.2 server</p>
  
  <p>A quick search suggests that the problem could be conflicting versions among various dependencies quoted in the pom.xml.</p>
  
  <blockquote>
    <p>What is the root cause &amp; solution for this error ?</p>
  </blockquote>
  
  <p><strong><em>Error while Running or Deploying the WAR</em></strong></p>
  
  <pre><code>java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.boot.SpringApplicationRunListener : org.springframework.boot.context.event.EventPublishingRunListener
      at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:381)
      at org.springframework.boot.SpringApplication.getRunListeners(SpringApplication.java:352)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:274)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
      at hello.Application.main(Application.java:25)
      ... 6 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
      at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:377)
      ... 11 more
  Caused by: java.lang.NoSuchFieldError: INSTANCE
      at org.springframework.boot.SpringApplication.asUnmodifiableOrderedSet(SpringApplication.java:1031)
      at org.springframework.boot.SpringApplication.getListeners(SpringApplication.java:930)
      at org.springframework.boot.context.event.EventPublishingRunListener.&lt;init&gt;(EventPublishingRunListener.java:47)
      ... 16 more
  </code></pre>
  
  <p><strong><em>Here is my complete POM.xml</em></strong></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;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;gs-spring-boot&lt;/artifactId&gt;
      &lt;version&gt;0.1.0&lt;/version&gt;
      &lt;!-- ... --&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;!-- ... --&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.1.10.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
  &lt;!--           &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;   --&gt;          
          &lt;/dependency&gt;
  
            &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt; 
  
  &lt;!-- &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
      &lt;version&gt;3.1.1.RELEASE&lt;/version&gt;
  &lt;/dependency&gt; --&gt;
  
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.session&lt;/groupId&gt;
        &lt;artifactId&gt;spring-session-data-redis&lt;/artifactId&gt;
        &lt;version&gt;1.0.0.RELEASE&lt;/version&gt;
        &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;   
  
       &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
        &lt;version&gt;4.1.3.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
      &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
      &lt;version&gt;3.2.5.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
      &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
      &lt;version&gt;3.2.5.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;  
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.orange.redis-embedded&lt;/groupId&gt;
      &lt;artifactId&gt;embedded-redis&lt;/artifactId&gt;
      &lt;version&gt;0.5&lt;/version&gt;
  &lt;/dependency&gt;
  
  
         &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&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;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
      &lt;/properties&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;plugin&gt;
                  &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;integration-test&lt;/goal&gt;
                              &lt;goal&gt;verify&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>