2016-12-06 2 views
2

Я начинаю весенний ботинок с подносом. это errer сообщениеЯ стараюсь использовать подножку в весеннем ботинке, но это ошибка

10:17:49.123 [main] ERROR org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroy method on bean with name 'org.springframework.context.annotation.internalScheduledAnnotationProcessor' threw an exception 
10:17:49.128 [main] ERROR org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroy method on bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' threw an exception 
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot[email protected]71ba6d4e: startup date [Tue Dec 06 10:17:46 CST 2016]; root of context hierarchy 
    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578) [spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554) [spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:954) [spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523) [spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:961) [spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033) [spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:555) [spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] 
    at com.test.Application.main(Application.java:34) [main/:?] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92] 
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92] 
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:?] 
10:17:49.128 [main] ERROR org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroy method on bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' threw an exception 
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot[email protected]71ba6d4e: startup date [Tue Dec 06 10:17:46 CST 2016]; root of context hierarchy 
    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578) [spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
10:17:49.129 [main] ERROR org.springframework.beans.factory.support.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.boot[email protected]71ba6d4e: startup date [Tue Dec 06 10:17:46 CST 2016]; root of context hierarchy 
    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
10:17:49.133 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'embeddedServletContainerCustomizerBeanPostProcessor': BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cachingConfig' defined in file [D:\workspace\test\build\classes\main\com\test\config\CachingConfig.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:478) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cachingConfig' defined in file [D:\workspace\test\build\classes\main\com\test\config\CachingConfig.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:671) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:370) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE] 

build.gradle

configurations { 
    compile.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging' 
    compile.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' 
} 

task wrapper(type: Wrapper) { 
    gradleVersion = '3.1' 
} 

dependencies { 
    providedRuntime(
      'org.springframework.boot:spring-boot-starter-undertow:1.4.2.RELEASE' 
    ) 
    testCompile(
      'junit:junit:4.11', 
      "org.springframework.boot:spring-boot-starter-test:1.4.2.RELEASE", 
      'org.spockframework:spock-core:1.1-groovy-2.4-rc-1', 
      'org.spockframework:spock-spring:1.1-groovy-2.4-rc-1', 
      //微基准测试 
      'org.openjdk.jmh:jmh-core:1.13', 
      'org.openjdk.jmh:jmh-generator-annprocess:1.13' 
    ) 
    compile(
      'org.springframework.boot:spring-boot-starter:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-web:1.4.2.RELEASE', 
//   'org.springframework.boot:spring-boot-starter-jersey:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-validation:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-actuator:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-jdbc:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-log4j2:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-configuration-processor:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-data-mongodb:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-data-redis:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-mail:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-aop:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-data-rest:1.4.2.RELEASE', 
      'org.springframework.boot:spring-boot-starter-freemarker:1.4.2.RELEASE', 
      'org.codehaus.groovy:groovy-all:2.4.7', 
      'cglib:cglib-nodep:3.2.4', 
      'org.objenesis:objenesis:2.4', 
      //异步日志支持 
      'com.lmax:disruptor:3.3.4', 
      //mybatis 
      'org.mybatis:mybatis:3.3.1', 
      'org.mybatis:mybatis-spring:1.2.4', 
      'com.github.pagehelper:pagehelper:4.1.3', 
      //mysql 
      'mysql:mysql-connector-java:5.1.38', 
      //数据库连接池 
      'com.alibaba:druid:1.0.18', 
      //java工具类 
      'com.google.guava:guava:19.0', 

      // apache的commons工具类 
      'commons-io:commons-io:2.4', 
      'org.apache.commons:commons-lang3:3.4', 
      'commons-codec:commons-codec:1.10', 
      'commons-fileupload:commons-fileupload:1.3.1', 
      'commons-beanutils:commons-beanutils:1.9.2', 
      //java guava工具类 
      'com.google.guava:guava:19.0', 
      //java collections 工具类 
      'org.eclipse.collections:eclipse-collections:8.0.0-M1', 
      'org.eclipse.collections:eclipse-collections-testutils:8.0.0-M1', 
      //操作redis 
      'redis.clients:jedis:2.8.1', 
      //json 
      'com.fasterxml.jackson.core:jackson-databind:2.7.3', 
      'com.fasterxml.jackson.core:jackson-core:2.7.3', 
      'com.fasterxml.jackson.core:jackson-annotations:2.7.3', 
      'com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.7.3', 
      //pojo copy 
      'net.sf.dozer:dozer:5.5.1', 
      //image util 
      //metadata-extractor is a straightforward Java library for reading metadata from image files. 
      'com.drewnoakes:metadata-extractor:2.8.1', 
      //Thumbnailator is a thumbnail generation library for Java. 
      'net.coobird:thumbnailator:0.4.8', 
      //二维码 
      'com.google.zxing:core:3.2.1', 
      'com.google.zxing:javase:3.2.1', 
      //shiro 
      'org.apache.shiro:shiro-core:1.2.4', 
      'org.apache.shiro:shiro-web:1.2.4', 
      'org.apache.shiro:shiro-ehcache:1.2.4', 
      'org.apache.shiro:shiro-spring:1.2.4', 
      'org.apache.shiro:shiro-cas:1.2.4', 
      //ant 
      'org.apache.ant:ant:1.9.6', 

      //servlet 
      'javax.servlet:javax.servlet-api:4.0.0-b01', 
      'javax.servlet.jsp:jsp-api:2.2.1-b03', 
      //管理项目中API接口 
      'com.mangofactory:swagger-springmvc:1.0.2', 
      'io.springfox:springfox-swagger2:2.5.0', 
      //http 请求工具 
      'com.sun.jersey:jersey-core:1.19.2', 
      'com.sun.jersey:jersey-client:1.19.2', 
      'com.sun.jersey.contribs:jersey-multipart:1.19.2' 
    ) 
} 

но мой проект incloud валидатор банка. если добавить этот код

// @Bean 
// public UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() { 
// UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory(); 
// factory.addBuilderCustomizers(builder -> builder.addHttpListener(80, "0.0.0.0") 
//  .setServerOption(UndertowOptions.ENABLE_HTTP2, true)); 
// return factory; 

ошибка: java.lang.ClassNotFoundException: io.undertow.Undertow $ Builder

, если я использую tocmat или причал, это нормально Я не уверен, если это Проблемы с Spring Boot или Undertow.

это мой Lib список this's my lib list

+0

Вы даже используете плагин для загрузки весны? Похоже, что вам не хватает зависимостей 'hibernate-validator' и, судя по зависимостям, которые вы включили, очень старайтесь не использовать предоставленные зависимости от стартеров. –

+0

Я уверен, что зависимости включают в себя зависимость 'hibernate-validator' –

+0

Не в соответствии с вашей stacktrace ...' java.lang.NoClassDefFoundError: Не удалось инициализировать класс org.hibernate.validator.internal.engine.ConfigurationImpl', кажется, это не так. –

ответ

0

я решил эту ошибку:

Вызванный: java.lang.NoClassDefFoundError: Не удалось инициализировать класс org.hibernate.validator.internal.engine.ConfigurationImpl

добавить эту недостающую зависимость:

<dependency> 
     <groupId>org.jboss.logging</groupId> 
     <artifactId>jboss-logging</artifactId> 
     <version>3.2.0.Final</version> 
    </dependency>