Announcement Announcement Module
Collapse
No announcement yet.
Spring Validation and Hibernate-Validator 5.0.1.Final does not work Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Validation and Hibernate-Validator 5.0.1.Final does not work

    I'm using the @Validated Annotation in my project.
    When i tried to update to the current hibernate-validator version (5.0.1.Final) this causes a classDefNotFound Exception

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.MethodValidationPostProcessor#0' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/validator/method/MethodConstraintViolationException
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:741) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) ~[spring-webmvc-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[javax.servlet-3.0.0.v201112011016.jar:na]
    	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:519) [jetty-servlet-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:331) [jetty-servlet-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:742) [jetty-servlet-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265) [jetty-servlet-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1252) [jetty-webapp-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710) [jetty-server-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) [jetty-webapp-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.server.Server.doStart(Server.java:280) [jetty-server-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.10.v20130312.jar:8.1.10.v20130312]
    	at net.bigpoint.platform.utilities.test.rest.EmbeddedJetty.startJetty(EmbeddedJetty.java:133) [test-0.11.12-SNAPSHOT.jar:na]
    	at net.bigpoint.platform.utilities.test.rest.EmbeddedJetty.init(EmbeddedJetty.java:96) [test-0.11.12-SNAPSHOT.jar:na]
    	at net.bigpoint.platform.auth.EmbeddedAuthenticationWebapp.init(EmbeddedAuthenticationWebapp.java:99) [test-classes/:na]
    	at net.bigpoint.platform.auth.WebappApplicationContextBaseIT.initialize(WebappApplicationContextBaseIT.java:20) [test-classes/:na]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_09]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_09]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_09]
    	at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_09]
    	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) [testng-6.8.jar:na]
    	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564) [testng-6.8.jar:na]
    	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213) [testng-6.8.jar:na]
    	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) [testng-6.8.jar:na]
    	at org.testng.TestRunner.beforeRun(TestRunner.java:641) [testng-6.8.jar:na]
    	at org.testng.TestRunner.run(TestRunner.java:609) [testng-6.8.jar:na]
    	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) [testng-6.8.jar:na]
    	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) [testng-6.8.jar:na]
    	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) [testng-6.8.jar:na]
    	at org.testng.SuiteRunner.run(SuiteRunner.java:240) [testng-6.8.jar:na]
    	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) [testng-6.8.jar:na]
    	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) [testng-6.8.jar:na]
    	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198) [testng-6.8.jar:na]
    	at org.testng.TestNG.runSuitesLocally(TestNG.java:1123) [testng-6.8.jar:na]
    	at org.testng.TestNG.run(TestNG.java:1031) [testng-6.8.jar:na]
    	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:76) [surefire-testng-2.12.jar:2.12]
    	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:112) [surefire-testng-2.12.jar:2.12]
    	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:115) [surefire-testng-2.12.jar:2.12]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_09]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_09]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_09]
    	at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_09]
    	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.jar:2.12]
    	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.jar:2.12]
    	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.jar:2.12]
    	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103) [surefire-booter-2.12.jar:2.12]
    	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) [surefire-booter-2.12.jar:2.12]
    Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/method/MethodConstraintViolationException
    	at org.springframework.validation.beanvalidation.MethodValidationPostProcessor.afterPropertiesSet(MethodValidationPostProcessor.java:101) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1547) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1485) ~[spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    	... 62 common frames omitted
    Caused by: java.lang.ClassNotFoundException: org.hibernate.validator.method.MethodConstraintViolationException
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_09]
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_09]
    	at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_09]
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_09]
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:423) ~[na:1.7.0_09]
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.7.0_09]
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ~[na:1.7.0_09]
    	... 65 common frames omitted
    There is no MethodConstraintViolationException in version 5 anymore. is there allready support for this in spring? or should i stick with version 4/implement my own post processor?

    Greetings,
    Alexander
Working...
X