JBoss EAP 6.4 uses al older version of Bean Validation than Spring Boot 1.3.0.M4, after excluding the libraries in question from the jboss deployment descriptor
<exclusions>
<module name="org.hibernate.validator" />
<module name="javax.validation.api" />
</exclusions>
I get the following exception
Error calling onStartup for servlet container initializer: org.springframework.web.SpringServletContainerInitialize r: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of in it method failed; nested exception is java.lang.NoSuchMethodError: javax.validation.spi.ConfigurationState.getParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:207) [spring-context-4.2.0.RELEASE.jar:4.2.0.RELEA SE]
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:682) [spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:522) [spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) [spring-boot-1.3.0.M4.jar:1.3.0.M4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:667) [spring-boot-1.3.0.M4.jar:1.3.0.M4]
at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:342) [spring-boot-1.3.0.M4.jar:1.3.0.M4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:273) [spring-boot-1.3.0.M4.jar:1.3.0.M4]
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:130) [spring-boot-1.3.0.M4.jar:1.3.0.M4]
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:110) [spring-boot-1.3.0.M4.jar:1.3.0.M4]
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:69) [spring-boot-1.3.0.M4.jar:1.3.0.M4]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:187) [jboss-as-web-7.5.2.Final-redhat-2.jar:7.5.2.Final-redhat-2]
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [jbossweb-7.5.9.Final-redhat-1.jar:7.5.9.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3775) [jbossweb-7.5.9.Final-redhat-1.jar:7.5.9.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.2.Final-redhat-2.jar:7.5.2.Final-redhat-2]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.2.Final-redhat-2.jar:7.5.2.Final-redhat-2]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.2.Final-redhat-2.jar:7.5.2.Final-redhat-2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.NoSuchMethodError: javax.validation.spi.ConfigurationState.getParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:142) [hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:35) [hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:291) [hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:277) [spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$Jsr303ValidatorFactory.run(ConfigurationPropertiesBindingPostProcessor.java:382) [spring-boot-1.3. 0.M4.jar:1.3.0.M4]
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.afterPropertiesSet(ConfigurationPropertiesBindingPostProcessor.java:178) [spring-boot-1.3.0.M4.jar :1.3.0.M4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE ]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) [spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
... 29 more
Comment From: snicoll
Can you update your description to provide the actual stacktrace please? Spring Framework is making sure to guard calls to the Bean validation 1.1 API so I'd be curious to understand where the error is actually coming from.
Comment From: asegarra
updated with stacktrace
Comment From: snicoll
You have the wrong hibernate validator dependency. Look closer at the stacktrace, it is failing in hibernate validator itself, not spring boot
Caused by: java.lang.NoSuchMethodError: javax.validation.spi.ConfigurationState.getParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.(ValidatorFactoryImpl.java:142) [hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:35) [hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
Comment From: asegarra
Yeah it seems JBoss is still forcing the old lib it ships with even though I excluded the modules. Thanks!.
Comment From: cleankod
Have you found any solution for this exclusion not working? I have the same problem with JBoss EAP 7.4...
Comment From: SanjayGautam
Hi,
I am currently facing the similar issue , I tried to create a new slots for the validation and persistence api to update to the latest version of apis , but still it is not excluding the default libraries .
Comment From: kranthiboinpally
Hi I am facing similar problem with JBOSS 6.4, did you find any solution?
Comment From: eljog
Do anyone has a solution for this?
Comment From: bsachin89
Does anybody have solution for this?