Answer the question
In order to leave comments, you need to log in
How to run a default Spring boot 2.x application?
Hello.
I generate an application skeleton on start.spring.io (Java, Maven, Boot 2.0.0 M7). Without any edits, I try to run it and get the following stack trace:
2017-12-04 17:44:49.150 WARN 19558 --- [ main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'NettyReactiveWebServerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerConfiguration$ReactorNettyAutoConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultReactiveWebServerCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'defaultReactiveWebServerCustomizer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl
2017-12-04 17:44:49.155 INFO 19558 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2017-12-04 17:44:49.162 ERROR 19558 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'NettyReactiveWebServerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerConfiguration$ReactorNettyAutoConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultReactiveWebServerCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'defaultReactiveWebServerCustomizer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:72) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:57) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:751) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:387) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
.....
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.createWebServer(ReactiveWebServerApplicationContext.java:95) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:69) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
... 8 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultReactiveWebServerCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'defaultReactiveWebServerCustomizer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': 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.ConstructorResolver.createArgumentArray(ConstructorResolver.java:729) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:470) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
...
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
... 16 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': 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.doCreateBean(AbstractAutowireCapableBeanFactory.java:591) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
....
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:721) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
... 33 common frames omitted
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:33) ~[hibernate-validator-6.0.5.Final.jar:6.0.5.Final]
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:296) ~[validation-api-2.0.0.Final.jar:na]
at org.springframework.boot.validation.MessageInterpolatorFactory.getObject(MessageInterpolatorFactory.java:53) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.boot.context.properties.ValidatedLocalValidatorFactoryBean.<init>(ValidatedLocalValidatorFactoryBean.java:35) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.boot.context.properties.ConfigurationPropertiesBinderBuilder.determineValidator(ConfigurationPropertiesBinderBuilder.java:150) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.boot.context.properties.ConfigurationPropertiesBinderBuilder.build(ConfigurationPropertiesBinderBuilder.java:137) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.getBinder(ConfigurationPropertiesBindingPostProcessor.java:196) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:167) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:423) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
... 43 common frames omitted
Answer the question
In order to leave comments, you need to log in
NoClassDefFoundError indicates that the class could not be found in the application's classpath at the time the code was executed. Those. it is present at compile time, but not available at run time. Have a look at runtime and compile dependencies. I think if you put your "skeleton" on Github and give people a link, you will quickly be pointed to the cause of the error.
Probably it was necessary to do maven reimport. Then clean install. Perhaps there was some kind of glitch.
In general, install a plugin or use dependency hiearchy (maven helper seems to be under IDEA), and there you can search for this class in some lib, is it there, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question