Announcement Announcement Module
No announcement yet.
bean error Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • bean error

    I'm trying to make a login form with spring 3 mvc

    But I keep getting this error:
    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: Could not initialize class org.hibernate.validator.engine.ConfigurationImpl
    This is my bean-servlet
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns=""
    xmlns:xsi="" xmlns:p=""
    <!-- Enable annotation driven controllers, validation etc... -->
    <mvc:annotation-driven />
    <context:component-scan base-package="org.allmystuff.controllers" />
    <bean id="viewResolver"
    <property name="prefix">
    <property name="suffix">
    <bean id="messageSource"
    <property name="basename" value="/WEB-INF/messages" />
    Hope someone can help me.

  • #2
    NoClassDefFoundError could be:

    - you're missing a required jar on your classpath (maybe Hibernate jar?);

    - you have an incompatibility between two of the jars you're using (like using too old version of hibernate with new version of spring, or viceversa, or something like that);

    - you have classloader issues, determined by double jar definition with different versions, jars shipped with the container, etc.

    I suggest you:

    - activate log4j by putting a log4j.xml or with log4j configuration in your /WEB-INF/classes folder and redeploy the application;

    - looking at the logs you will find the name and package of the class that is required and isn't found;

    - check that this class exists in one of the jars in WEB-INF/lib, and that it's correctly exported when you generate the war/ear;

    - look at the libraries shipped with your container, and double-check that there are no "doubles". Also check for doubles in your application classpath.


    use Maven to handle your dependencies; once you've learned using it well, you'll never have problems like this again.