Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Problems with validation files Spring mvc 3

0

43 views

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 t 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

asked June 24, 2011 12:20 am CDT
posted via StackOverflow

0 Answers

Be the first to answer this question

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
PO Box Validation
March 1, 2011
Regex for URL Validation
January 29, 2011
PHP - Email Validation
February 5, 2011
IPv6 validation
May 11, 2011
Php regex date validation
February 17, 2011
Regex password validation
February 16, 2011