Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Exception trying to utilize hibernate validator 4.0.2.GA
PostPosted: Wed Nov 18, 2009 4:02 pm 
Newbie

Joined: Wed Nov 18, 2009 11:55 am
Posts: 2
From what I can tell, these are the most recent two versions of these particular jars, meant to work in conjunction:

hibernate-validator-4.0.2.GA.jar
validation-api-1.0.CR5.jar

I've included these in my project I'm trying incorporate validation functionality into my project as described by this blog post: http://blog.jteam.nl/2009/08/04/bean-va ... th-spring/

I have a single entity class annotated with the @NotEmpty annotation and the following exception is thrown when I try to test:

Code:
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/metadata/ElementDescriptor$ConstraintFinder
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:924)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
   org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.NoClassDefFoundError: javax/validation/metadata/ElementDescriptor$ConstraintFinder
   org.hibernate.validator.metadata.BeanMetaDataImpl.createMetaData(BeanMetaDataImpl.java:233)
   org.hibernate.validator.metadata.BeanMetaDataImpl.<init>(BeanMetaDataImpl.java:117)
   org.hibernate.validator.metadata.BeanMetaDataImpl.<init>(BeanMetaDataImpl.java:106)
   org.hibernate.validator.engine.ValidatorImpl.getBeanMetaData(ValidatorImpl.java:735)
   org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:202)
   org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
   main.java.com.upmc.pcas.web.validation.BeanValidator.validate(BeanValidator.java:29)
   main.java.com.upmc.pcas.web.controller.DiseaseAtrController.submitForm(DiseaseAtrController.java:90)
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
   org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
   org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)
   org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
   org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.ClassNotFoundException: javax.validation.metadata.ElementDescriptor$ConstraintFinder
   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
   java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
   org.hibernate.validator.metadata.BeanMetaDataImpl.createMetaData(BeanMetaDataImpl.java:233)
   org.hibernate.validator.metadata.BeanMetaDataImpl.<init>(BeanMetaDataImpl.java:117)
   org.hibernate.validator.metadata.BeanMetaDataImpl.<init>(BeanMetaDataImpl.java:106)
   org.hibernate.validator.engine.ValidatorImpl.getBeanMetaData(ValidatorImpl.java:735)
   org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:202)
   org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
   main.java.com.upmc.pcas.web.validation.BeanValidator.validate(BeanValidator.java:29)
   main.java.com.upmc.pcas.web.controller.DiseaseAtrController.submitForm(DiseaseAtrController.java:90)
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
   org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
   org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)
   org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
   org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


I've looked in the api and I cannot seem to find this ConstraintFinder method anywhere in any of the javax.validation api's that I can find. Help?


Top
 Profile  
 
 Post subject: Re: Exception trying to utilize hibernate validator 4.0.2.GA
PostPosted: Thu Nov 19, 2009 2:50 pm 
Newbie

Joined: Wed Nov 18, 2009 11:55 am
Posts: 2
Nevermind. Turned out maven was pulling down the wrong jar for me. 1.0.CR5 vs 1.0.0.GA.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.