Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Hibernate Exception: Unable to build the default ValidatorFactory

Posted on 2011-09-08
1
2,716 Views
Last Modified: 2012-05-12
Hi Experts,

   I have environment installed as below
    Spring 2.5.4
    Hibernate 3.7
   GWT 2.4

   I have included all the hibernate library jars (I  don't have hibernate validator installed)

   When I build the application, I have error message below.

   It looks like the GWT adds the validation jar gwt-2.4.0/validation-api-1.0.0.GA.jar, I'm not sure if that is the reason for Hibernate to fail to build.

   Please help!                                  



[ INFO] 09/08/11 16:47:38 <org.springframework.beans.factory.support.DefaultListableBeanFactory:preInstantiateSingletons():414>:
    Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@bb70ad: defining beans [userAdminDataSource,userInfoSource,transactionManager,sessionFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.config.internalTransactionAdvisor,ldapDAO,usersDao,userAdminDao,userService,emailNotificationService,mailSender]; root of factory hierarchy

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[WARN] Server class 'javax.validation.Validation' could not be found in the web app, but was found on the system classpath
   [WARN] Adding classpath entry 'file:/C:/AuditProgram/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.r36v201108301710/gwt-2.4.0/validation-api-1.0.0.GA.jar' to the web app classpath for this session
   For additional info see: file:/C:/AuditProgram/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.r36v201108301710/gwt-2.4.0/doc/helpInfo/webAppClassPath.html
[ INFO] 09/08/11 16:47:39 <org.springframework.beans.factory.support.DefaultSingletonBeanRegistry:destroySingletons():396>:
    Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@bb70ad: defining beans [userAdminDataSource,userInfoSource,transactionManager,sessionFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.config.internalTransactionAdvisor,ldapDAO,usersDao,userAdminDao,userService,emailNotificationService,mailSender]; root of factory hierarchy

09/08/11 16:47:39 <org.springframework.web.context.ContextLoader:initWebApplicationContext():215>:
    Context initialization failed



09/08/11 <org.springframework.web.context.ContextLoader:initWebApplicationContext():215>:
    Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.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:1336)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
      at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
      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:1704)
      at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1654)
      at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1445)
      at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:673)
      at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1367)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)
      ... 33 more
Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:118)
      ... 41 more
Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory
      at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:383)
      at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:109)
      ... 46 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:380)
      ... 47 more
0
Comment
Question by:SarahDeng
1 Comment
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
ID: 36929863
hi,

please refer the below thread.

1. https://forum.hibernate.org/viewtopic.php?f=26&t=999942
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
tomcat administrtor 12 59
What's wrong with this code? 4 26
ejb entity bean example 2 10
Is there a simpler dropbox system? 10 34
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question