2 Replies Latest reply on Jun 29, 2015 5:51 AM by nitin.shukla

    JBoss AS 7.2 facing HibernateException: Unable to get the default Bean Validation factory

    nitin.shukla

      Hello,

       

      I am migrating my application from JBoss AS 7.1 to JBoss AS 7.2. After configuring standalone.xml in the 7.2 server I am facing issue during startup. Below is the log with error. It looks that Hibernate Validator is not loaded leading to failure to load spring bean sessionFactory.

       

      2015-06-25 20:44:34,274 INFO  [ServerService Thread Pool -- 6:] [org.hibernate.cfg.Configuration] Hibernate Validator not found: ignoring
      2015-06-25 20:44:34,303 ERROR [ServerService Thread Pool -- 6:] [org.springframework.web.context.ContextLoader] Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory

       

      However when I run the same application in JBoss AS 7.1 the application starts up fine with any issues. Interestingly I do see in the logs of AS 7.1 "Hibernate Validator not foud: ignoring", however all beans are initialized/loaded and server starts without any issue.

       

      My application is using Spring 3.1.0 and hibernate 3.6.0. I am unclear as to what am I missing to configure for AS 7.2. Any pointers to help resolve the issue will be appreciated.

        • 1. Re: JBoss AS 7.2 facing HibernateException: Unable to get the default Bean Validation factory
          nitin.shukla

          Hi,

           

          In attempt to get over the issue, I have attempted to include the module <module name="org.hibernate.validator" /> as dependency in jboss-deployment-structure.xml that is place in the WEB-INF folder of the war file of my application. However I still observe in logs "Hibernate Validator not found: ignoring" and the failure to load sessionFactory bean (org.springframework.orm.hibernate3.LocalSessionFactoryBean) with the same Hibernate Exception. Any help/pointers in resolving the issue is appreciated.

           

          Thanks.

           

          • 2. Re: JBoss AS 7.2 facing HibernateException: Unable to get the default Bean Validation factory
            nitin.shukla

            Hello,

             

            I finally got the issue resolved by adding hibernate-validator-4.0.2.GA.jar and validation-api-1.0.0.GA.jar in my web application. Now running the application on AS 7.2 is fine since Hibernate Validator is loaded at the server startup.

             

            However I am still clueless as to how AS 7.1 was starting up by ignoring the missing Hibernate Validator while in AS 7.2 complains about missing Hibernate Validator and will not budge till it finds one. I must be missing some configuration in AS 7.2. If someone from the community can point it, it will be appreciated.

             

            Regards,

            Nitin