<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Hibernate 3 validation: Unable to find a default provider
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/guinotphil">guinotphil</a> in <i>JBoss AS7 Development</i> - <a href="http://community.jboss.org/message/619053#619053">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hello !</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'm trying to deploy an EAR application running on Hibernate 3.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>I've been following the steps on </span><a class="jive-link-external-small" href="https://docs.jboss.org/author/display/AS7/JPA+Reference+Guide" target="_blank">https://docs.jboss.org/author/display/AS7/JPA+Reference+Guide</a><span> by adding a module org.hibernate3 and adding in my persitence.xml:</span></p><p><property name=<span class="code-quote">"jboss.as.jpa.providerModule"</span> value=<span class="code-quote">"org.hibernate3"</span>/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My module org.hibernate3 contains the following jar and dependencies:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;"><module xmlns="urn:jboss:module:1.0" name="org.hibernate3"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <resources></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <resource-root path="hibernate-core-3.6.6.Final.jar"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <resource-root path="hibernate-entitymanager-3.6.6.Final.jar"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <resource-root path="hibernate-validator-3.1.0.GA.jar"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <resource-root path="hibernate-commons-annotations-3.2.0.Final.jar"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <!-- Insert resources here --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </resources></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <dependencies></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="asm.asm"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="javax.api"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="javax.persistence.api"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="javax.transaction.api"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="javax.validation.api"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.antlr"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.apache.ant"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.apache.commons.collections"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.dom4j"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.infinispan"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.javassist"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.jboss.as.jpa.hibernate3"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.jboss.logging"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <module name="org.slf4j"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </dependencies></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;"></module></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My trouble is that when I try to deploy the application I get the following error:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">javax.persistence.PersistenceException: [PersistenceUnit: entityManagerFactory] Unable to configure EntityManagerFactory</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:378) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:81) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.seam.Component.callComponentMethod(Component.java:2257) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.seam.Component.callCreateMethod(Component.java:2172) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.seam.Component.newInstance(Component.java:2132) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    ... 63 more</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:127) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(Configuration.java:1704) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1654) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1445) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1519) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1100) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:282) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:366) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    ... 77 more</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: java.lang.reflect.InvocationTargetException</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:118) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    ... 86 more</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:383) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:109) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    ... 91 more</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: javax.validation.ValidationException: Unable to find a default provider</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:264) [validation-api-1.0.0.GA.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111) [validation-api-1.0.0.GA.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:380) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    ... 92 more</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I've <span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">also tried to upgrade hibernate-validator to hibernate-val</span>idator-4.2.0.Final.jar + hibernate-validator-legacy-4.0.2.GA.jar, but I'm still getting the same error.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Is there a way to make validation working with Hibernate 3 on JBoss AS 7 ? Or should I disable validation (how?) ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thank you very much !</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/619053#619053">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS7 Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>