Announcement Announcement Module
Collapse
No announcement yet.
ValidationException: Unable to find a default provider Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ValidationException: Unable to find a default provider

    I'm having an issue with hibernate under spring. It doesn't appear to be finding my hibernate validator. Here is the stack trace:

    Code:
    357 [main] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
    1336 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@c95b412: defining beans [calendarDatabase,sessionFactory,testDatabase,testSessionFactory,txManager,authKeyDAO,failedLoginDAO,systemUserDAO,mailSender,emailNotifier,resourceBundle,securityService,newUserEmailTemplate,resetPasswordEmailTemplate,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,apiController,loginController]; root of factory hierarchy
    1337 [main] ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/db.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
    	at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
    	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    	at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:616)
    	at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
    	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
    	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
    	at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:468)
    	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    	at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
    	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    	at org.mortbay.jetty.Server.doStart(Server.java:222)
    	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    	at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:672)
    	at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
    	at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
    	at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
    	at com.google.gwt.dev.DevMode.main(DevMode.java:311)
    Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory
    	at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:127)
    	at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(Configuration.java:1674)
    	at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1624)
    	at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1415)
    	at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1345)
    	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)
    	at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    	... 37 more
    Caused by: java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:601)
    	at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:118)
    	... 45 more
    Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory
    	at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:345)
    	at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:106)
    	... 50 more
    Caused by: javax.validation.ValidationException: Unable to find a default provider
    	at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:264)
    	at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
    	at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:342)
    	... 51 more
    I copied in where it says Validator not found, ignoring at the top b/c I thought it might be helpful.

    I have attached the build path for my eclipse project.

    Thanks.

  • #2
    See this: "I tried all version of hibernate 3.6. series.Same issue is there.When i tried hibernate 3.5.6 final version (Just upper one of 3.6 series)..it is working fine."


    The .jpg is very small :-)

    Comment


    • #3
      Sorry about the small jpg. I uploaded a png, it must have translated and shrunk.

      Do I just replace hibernate3.jar?

      Comment


      • #4
        First, investigate about the dependencies, I recommed to use Maven.

        Comment


        • #5
          NEVER AGAIN! But I understand why you say that.

          Thanks for the advice. I simply updated hibernate3.jar and everything appears to be working properly. Thanks for the help.

          Comment

          Working...
          X