Hibernate Exception: Unable to build the default ValidatorFactory

Posted on 2011-09-08
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 <>:
    Pre-instantiating singletons in 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 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/' to the web app classpath for this session
   For additional info see: file:/C:/AuditProgram/eclipse/plugins/
[ INFO] 09/08/11 16:47:39 <>:
    Destroying singletons in 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 Method)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(
      at org.mortbay.jetty.handler.ContextHandler.startContext(
      at org.mortbay.jetty.servlet.Context.startContext(
      at org.mortbay.jetty.webapp.WebAppContext.startContext(
      at org.mortbay.jetty.handler.ContextHandler.doStart(
      at org.mortbay.jetty.webapp.WebAppContext.doStart(
      at org.mortbay.component.AbstractLifeCycle.start(
      at org.mortbay.jetty.handler.HandlerWrapper.doStart(
      at org.mortbay.jetty.handler.RequestLogHandler.doStart(
      at org.mortbay.component.AbstractLifeCycle.start(
      at org.mortbay.jetty.handler.HandlerWrapper.doStart(
      at org.mortbay.jetty.Server.doStart(
      at org.mortbay.component.AbstractLifeCycle.start(
Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory
      at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(
      at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(
      at org.hibernate.cfg.Configuration.applyConstraintsToDDL(
      at org.hibernate.cfg.Configuration.secondPassCompile(
      at org.hibernate.cfg.Configuration.buildMappings(
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(
      at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(
      ... 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(
      ... 41 more
Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory
      at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(
      at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(
      ... 46 more
Caused by: javax.validation.ValidationException: Unable to find a default provider
      at javax.validation.Validation$GenericBootstrapImpl.configure(
      at javax.validation.Validation.buildDefaultValidatorFactory(
      at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(
      ... 47 more
Question by:SarahDeng
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
1 Comment
LVL 21

Accepted Solution

Amitkumar Panchal earned 500 total points
ID: 36929863

please refer the below thread.


Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 64
restrict decimal places for double datatype 10 34
What browser will run Java? 7 128
DTD and JAVA versions 1 33
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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

730 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