Title: problems with validation files Spring mvc 3
Tags: validation;tomcat;spring-mvc
Question: I'm having some problem with the Validation files in my Spring 3 project.
I have a very basic validation project for tests thats the bean:

```public class User { 
    @NotEmpty(message="no blank name")
    @Size(min=2, max=20)
    private String name="";

    @NotEmpty(message="no blank email")
    @Email
    private String email="";
```

......getters and setters......
The function within the controller that accepts the request from the Form page and makes the necessary validation is:

```@RequestMapping(value="/displayUser",method=RequestMethod.POST)
public String displayUser(@Valid User user, Model model,BindingResult result){      
    if(result.hasErrors()){
        return "form";
    }
    userList.add(user);

    model.addAttribute("user",user);

    return "redirect:displayUser";
}
```

But i dont think the code is the cause of the problem, as as soon as i start the server and run the project "which has always been working, since i test other spring things in there" i get the following Exceptions:

```org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
    org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
    org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
    org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
    javax.servlet.GenericServlet.init(GenericServlet.java:212)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Thread.java:613)
```

Do you have any idea where thre problem could be?
I'm trying to figure out but nothing, 
P.S.: I use Tomcat 6 and i have just downloaded the:

```hibernate-validator-4.0.2.FINAL.jar
```

and 

```validation-api-1.0.0.GA.jar
```



Here is another answer: It looks to me like the class ```org.springframework.validation.beanvalidation.LocalValidatorFactoryBean``` cannot be resolved on your classpath. You need to add the JAR file ```spring-context.jar``` to your classpath.

Comment for this answer: It looks like this time it's a different class though that cannot be found right? In the end you just got to make sure you straighten out the dependency issues. What build tool (e.g. Ant/Maven) are you using to create your application?
Comment for this answer: There's certainly a JAR missing in the classpath. It might just be a transitive dependency. I think it would get easier with Maven or Gradle if you are familiar with these tools already. What JARs do you have in the directory `WEB-INF/lib` inside of your WAR file atm?
Comment for this answer: Hhmm, that is weird. Spring 3 should support JDK 5 and above. So you got your issue fully resolved?
Comment for this answer: Hi Benjamin, added the jar to classpath, refreshed the project, restarted the server but the problem is still there :java.lang.NoClassDefFoundError
 org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
 javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
 org.springframework.validation.beanvalidation.LocalValidatorFactoryB
Comment for this answer: Hi benjamin, i'm not using any, i have a pure project in Eclipse Galileo with all necessay(i think so) jars in classpath and lib folder, i'm very new to Spring, i just switched from Stripes framework. well basically the error its still the same, Tomcats error report page gives me these 2 root-cause errors the above mentioned and this one, ..... googleing does not really give good hints, and it seems like all files and jars are there

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2011:00:06/24/11', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<validation><tomcat><spring-mvc>', 'Title': 'problems with validation files Spring mvc 3', 'ViewCount': 4787, 'id': 6463740, 'user_AboutMe': '<p>Beginner java/jsp developer</p>\n', 'user_AccountId': 292165.0, 'user_DisplayName': 'JBoy', 'user_Reputation': 5223.0, 'user_Views': 422.0, 'user_id': 594765.0}}