title: Issue when running springboot application
body: <p>I develop a springboot application and I'm currently facing an issue when launching the application.</p>
  
  <p>Here is the stack trace of the error when I'n running the application. </p>
  
  <pre><code>2017-12-04 19:39:28.713  INFO 67222 --- [  restartedMain] c.g.www.xxx.xxxWebApplication  : Starting xxxWebApplication onxxx.sea.corp.expecn.com with PID 67222 (/Users/xxxx/dev/trash/xxx/target/classes started by xxxx in /Users/xxx/dev/trash/xxxx)
  2017-12-04 19:39:28.714 DEBUG 67222 --- [  restartedMain] c.g.www.xxx.xxxWebApplication  : Running with Spring Boot v1.5.8.RELEASE, Spring v4.3.12.RELEASE
  2017-12-04 19:39:28.714  INFO 67222 --- [  restartedMain] c.g.www.xxx.xxxWebApplication  : The following profiles are active: dev
  2017-12-04 19:39:28.910  INFO 67222 --- [  restartedMain] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@63e1e61: startup date [Mon Dec 04 19:39:28 PST 2017]; root of context hierarchy
  2017-12-04 19:39:29.081  WARN 67222 --- [  restartedMain] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.xxx.www.xxx.xxxWebApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer
  2017-12-04 19:39:29.083 ERROR 67222 --- [  restartedMain] o.s.b.f.s.DefaultListableBeanFactory     : Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
  
  java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.context.annotation.AnnotationConfigApplicationContext@63e1e61: startup date [Mon Dec 04 19:39:28 PST 2017]; root of context hierarchy
  at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:414)
  at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97)
  at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)
  at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.destroySingletons(FactoryBeanRegistrySupport.java:230)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968)
  </code></pre>
  
  <p>After a deep research, some people recommend to remove some dependencies in my POM. So, i ran the following command <strong>mvn dependency:tree</strong> to look the dependency tree. Viewing the dependency tree, I don't know which dependencies I have to remove. </p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO] 
  [INFO] ------------------------------------------------------------------------
  [INFO] Building xxx 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ xxx ---
  [INFO] com.xxx.www:xxx:war:0.0.1-SNAPSHOT
  [INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.5.8.RELEASE:compile
  [INFO] |  +- org.springframework.boot:spring-boot-starter:jar:1.5.8.RELEASE:compile
  [INFO] |  |  \- org.springframework.boot:spring-boot-starter-logging:jar:1.5.8.RELEASE:compile
  [INFO] |  |     +- ch.qos.logback:logback-classic:jar:1.1.11:compile
  [INFO] |  |     |  \- ch.qos.logback:logback-core:jar:1.1.11:compile
  [INFO] |  |     +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
  [INFO] |  |     \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
  [INFO] |  \- org.springframework.boot:spring-boot-actuator:jar:1.5.8.RELEASE:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.8.RELEASE:compile
  [INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.8.RELEASE:compile
  [INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.8.11:compile
  [INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.8.RELEASE:compile
  [INFO] |  |  +- org.apache.tomcat:tomcat-jdbc:jar:8.5.23:compile
  [INFO] |  |  |  \- org.apache.tomcat:tomcat-juli:jar:8.5.23:compile
  [INFO] |  |  \- org.springframework:spring-jdbc:jar:4.3.12.RELEASE:compile
  [INFO] |  +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
  [INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
  [INFO] |  |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
  [INFO] |  |  +- org.javassist:javassist:jar:3.21.0-GA:compile
  [INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
  [INFO] |  |  +- org.jboss:jandex:jar:2.0.0.Final:compile
  [INFO] |  |  +- dom4j:dom4j:jar:1.6.1:compile
  [INFO] |  |  \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
  [INFO] |  +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
  [INFO] |  +- javax.transaction:javax.transaction-api:jar:1.2:compile
  [INFO] |  +- org.springframework.data:spring-data-jpa:jar:1.11.8.RELEASE:compile
  [INFO] |  |  +- org.springframework.data:spring-data-commons:jar:1.13.8.RELEASE:compile
  [INFO] |  |  +- org.springframework:spring-orm:jar:4.3.12.RELEASE:compile
  [INFO] |  |  +- org.springframework:spring-tx:jar:4.3.12.RELEASE:compile
  [INFO] |  |  +- org.springframework:spring-beans:jar:4.3.12.RELEASE:compile
  [INFO] |  |  +- org.slf4j:slf4j-api:jar:1.7.25:compile
  [INFO] |  |  \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
  [INFO] |  \- org.springframework:spring-aspects:jar:4.3.12.RELEASE:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.5.8.RELEASE:compile
  [INFO] |  +- org.springframework:spring-aop:jar:4.3.12.RELEASE:compile
  [INFO] |  +- org.springframework.security:spring-security-config:jar:4.2.3.RELEASE:compile
  [INFO] |  |  \- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
  [INFO] |  \- org.springframework.security:spring-security-web:jar:4.2.3.RELEASE:compile
  [INFO] |     \- org.springframework:spring-expression:jar:4.3.12.RELEASE:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.5.8.RELEASE:compile
  [INFO] |  +- org.thymeleaf:thymeleaf-spring4:jar:2.1.5.RELEASE:compile
  [INFO] |  |  \- org.thymeleaf:thymeleaf:jar:2.1.5.RELEASE:compile
  [INFO] |  |     +- ognl:ognl:jar:3.0.8:compile
  [INFO] |  |     \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile
  [INFO] |  \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.4.0:compile
  [INFO] |     \- org.codehaus.groovy:groovy:jar:2.4.12:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.8.RELEASE:compile
  [INFO] |  +- org.hibernate:hibernate-validator:jar:5.3.5.Final:compile
  [INFO] |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
  [INFO] |  |  \- com.fasterxml:classmate:jar:1.3.4:compile
  [INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
  [INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
  [INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
  [INFO] |  +- org.springframework:spring-web:jar:4.3.12.RELEASE:compile
  [INFO] |  \- org.springframework:spring-webmvc:jar:4.3.12.RELEASE:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.8.RELEASE:provided
  [INFO] |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:provided
  [INFO] |  |  \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:provided
  [INFO] |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:provided
  [INFO] |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:provided
  [INFO] +- org.springframework.session:spring-session-data-redis:jar:1.3.1.RELEASE:compile
  [INFO] |  +- org.apache.commons:commons-pool2:jar:2.4.2:compile
  [INFO] |  +- org.springframework.data:spring-data-redis:jar:1.8.8.RELEASE:compile
  [INFO] |  |  +- org.springframework.data:spring-data-keyvalue:jar:1.2.8.RELEASE:compile
  [INFO] |  |  \- org.springframework:spring-oxm:jar:4.3.12.RELEASE:compile
  [INFO] |  +- org.springframework.session:spring-session:jar:1.3.1.RELEASE:compile
  [INFO] |  \- redis.clients:jedis:jar:2.9.0:compile
  [INFO] +- org.springframework.boot:spring-boot-devtools:jar:1.5.8.RELEASE:runtime
  [INFO] |  +- org.springframework.boot:spring-boot:jar:1.5.8.RELEASE:compile
  [INFO] |  \- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.8.RELEASE:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-mail:jar:1.5.8.RELEASE:compile
  [INFO] |  +- org.springframework:spring-context:jar:4.3.12.RELEASE:compile
  [INFO] |  +- org.springframework:spring-context-support:jar:4.3.12.RELEASE:compile
  [INFO] |  \- com.sun.mail:javax.mail:jar:1.5.6:compile
  [INFO] |     \- javax.activation:activation:jar:1.1:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.8.RELEASE:test
  [INFO] |  +- org.springframework.boot:spring-boot-test:jar:1.5.8.RELEASE:test
  [INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.8.RELEASE:test
  [INFO] |  +- com.jayway.jsonpath:json-path:jar:2.2.0:test
  [INFO] |  |  \- net.minidev:json-smart:jar:2.2.1:test
  [INFO] |  |     \- net.minidev:accessors-smart:jar:1.1:test
  [INFO] |  |        \- org.ow2.asm:asm:jar:5.0.3:test
  [INFO] |  +- junit:junit:jar:4.12:test
  [INFO] |  +- org.assertj:assertj-core:jar:2.6.0:test
  [INFO] |  +- org.mockito:mockito-core:jar:1.10.19:test
  [INFO] |  |  \- org.objenesis:objenesis:jar:2.1:test
  [INFO] |  +- org.hamcrest:hamcrest-core:jar:1.3:test
  [INFO] |  +- org.hamcrest:hamcrest-library:jar:1.3:test
  [INFO] |  +- org.skyscreamer:jsonassert:jar:1.4.0:test
  [INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
  [INFO] |  +- org.springframework:spring-core:jar:4.3.12.RELEASE:compile
  [INFO] |  \- org.springframework:spring-test:jar:4.3.12.RELEASE:test
  [INFO] +- org.webjars:bootstrap:jar:4.0.0-alpha.6:compile
  [INFO] +- org.webjars:jquery:jar:3.2.1:compile
  [INFO] +- mysql:mysql-connector-java:jar:5.1.44:runtime
  [INFO] +- org.codehaus.janino:janino:jar:2.7.8:compile
  [INFO] |  \- org.codehaus.janino:commons-compiler:jar:2.7.8:compile
  [INFO] +- com.nulab-inc:zxcvbn:jar:1.2.3:compile
  [INFO] +- biz.paluch.redis:lettuce:jar:3.5.0.Final:compile
  [INFO] |  +- io.reactivex:rxjava:jar:1.1.6:compile
  [INFO] |  +- io.netty:netty-common:jar:4.0.37.Final:compile
  [INFO] |  +- io.netty:netty-transport:jar:4.0.37.Final:compile
  [INFO] |  |  \- io.netty:netty-buffer:jar:4.0.37.Final:compile
  [INFO] |  +- io.netty:netty-handler:jar:4.0.37.Final:compile
  [INFO] |  |  \- io.netty:netty-codec:jar:4.0.37.Final:compile
  [INFO] |  \- com.google.guava:guava:jar:17.0:compile
  [INFO] +- com.mmnaseri.utils:spring-data-mock:jar:1.1.4:test
  [INFO] |  \- commons-logging:commons-logging:jar:1.2:test
  [INFO] +- org.testng:testng:jar:6.9.6:test
  [INFO] |  +- com.google.inject:guice:jar:no_aop:4.0:test
  [INFO] |  |  +- javax.inject:javax.inject:jar:1:test
  [INFO] |  |  \- aopalliance:aopalliance:jar:1.0:test
  [INFO] |  +- org.beanshell:bsh:jar:2.0b4:test
  [INFO] |  +- org.apache.ant:ant:jar:1.7.0:test
  [INFO] |  |  \- org.apache.ant:ant-launcher:jar:1.7.0:test
  [INFO] |  +- com.beust:jcommander:jar:1.48:test
  [INFO] |  \- org.yaml:snakeyaml:jar:1.17:runtime
  [INFO] \- org.hamcrest:hamcrest-all:jar:1.3:test
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 1.736 s
  [INFO] Finished at: 2017-12-04T20:09:26-08:00
  [INFO] Final Memory: 28M/437M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>Could someone advice on this issue, please ?</p>
  
  <p>Please find below some code from the main class</p>
  
  <pre><code>package com.xxx.www.xxx;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.autoconfigure.domain.EntityScan;
  import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
  import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
  import org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration;
  import org.springframework.boot.builder.SpringApplicationBuilder;
  import org.springframework.boot.web.support.SpringBootServletInitializer;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
  
  @SpringBootApplication
  @ComponentScan("com.xxx.www.xxx")
  @EntityScan("com.xxx.www.xxx.domain")
  @EnableJpaRepositories("com.xxx.www.xxx.repository")a
  @EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class})
  public class XXXWebApplication extends SpringBootServletInitializer {
  
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
      return application.sources(XXXWebApplication.class);
    }
  
    public static void main(String[] args) {
      SpringApplication.run(XXXWebApplication.class, args);
    }
  }
  </code></pre>
  
  <p>Below is the pom file</p>
  
  <pre><code>&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;java.version&gt;1.8&lt;/java.version&gt;
      &lt;spring-data-mock.version&gt;1.1.4&lt;/spring-data-mock.version&gt;
      &lt;testng.version&gt;6.9.6&lt;/testng.version&gt;
      &lt;hamcrest.version&gt;1.3&lt;/hamcrest.version&gt;
      &lt;zxcvbn.version&gt;1.2.3&lt;/zxcvbn.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
  
      &lt;!-- spring-boot --&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-data-jpa&lt;/artifactId&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;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&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;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-mail&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;!-- webjars --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.webjars&lt;/groupId&gt;
          &lt;artifactId&gt;bootstrap&lt;/artifactId&gt;
          &lt;version&gt;4.0.0-alpha.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.webjars&lt;/groupId&gt;
          &lt;artifactId&gt;jquery&lt;/artifactId&gt;
          &lt;version&gt;3.2.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- database --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- commons --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.janino&lt;/groupId&gt;
          &lt;artifactId&gt;janino&lt;/artifactId&gt;
          &lt;version&gt;2.7.8&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
          &lt;version&gt;3.7&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Password complexity library --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.nulab-inc&lt;/groupId&gt;
          &lt;artifactId&gt;zxcvbn&lt;/artifactId&gt;
          &lt;version&gt;${zxcvbn.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- test --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.mmnaseri.utils&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-mock&lt;/artifactId&gt;
          &lt;version&gt;${spring-data-mock.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.testng&lt;/groupId&gt;
          &lt;artifactId&gt;testng&lt;/artifactId&gt;
          &lt;version&gt;${testng.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
          &lt;artifactId&gt;hamcrest-all&lt;/artifactId&gt;
          &lt;version&gt;${hamcrest.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;repositories&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;/repository&gt;
  &lt;/repositories&gt;
  </code></pre>
  
  <p>Best,
  G</p>