<!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;">
    Re: 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/619140#619140">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Thank you for your reply.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Firstly, if I try and let in my EAR's <strong>jboss-deployment-structure.xml</strong> the exclusion of <strong>org.hibernate.validator</strong>, I optain the following error:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 8pt;">java.lang.NoClassDefFoundError: org/hibernate/validator/ClassValidator</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at java.lang.Class.getDeclaredMethods0(Native Method) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at java.lang.Class.getDeclaredMethods(Class.java:1791) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.seam.Component.initMembers(Component.java:550) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.seam.Component.&lt;init&gt;(Component.java:244) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.seam.Component.&lt;init&gt;(Component.java:205) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1186) [jboss-seam.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; ... 11 more</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: java.lang.ClassNotFoundException: org.hibernate.validator.ClassValidator from [Module "deployment.EAR_Project.ear.jboss-seam.jar:main" from Service Module Loader]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; ... 18 more</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Without the exclusion, so with an implicit dependency to hibernate validation 4.2 (be aware that I also added <strong>hibernate-validator-legacy-4.0.2.GA.jar</strong> to the org.hibernate.validator module), I optain the following error:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 8pt;">java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/XMember</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at java.lang.Class.getDeclaredConstructors0(Native Method) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at java.lang.Class.getConstructor0(Class.java:2699) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at java.lang.Class.getDeclaredConstructor(Class.java:1985) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.cfg.Configuration.applyHibernateValidatorLegacyConstraintsOnDDL(Configuration.java:1669) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1653) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; ... 22 more</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.XMember from [Module "org.hibernate.validator:main" from local module loader @12401369 (roots: C:\DEV\jboss-as-7.1.0.Alpha1-SNAPSHOT\modules)]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; ... 40 more</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Because the module has no access to the hibernate3 classes.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I haven't managed to found how to make this work, except by adding a depency to hibernate 3 in <strong>org.hibernate.validator</strong>'s <strong>module.xml</strong> (which I think is not good)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Well, now I got the folowing error :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 8pt;">javax.persistence.PersistenceException: [PersistenceUnit: entityManagerFactory] Unable to build EntityManagerFactory</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; 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;">&#160;&#160;&#160; ... 63 more</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:106) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:152) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870) [hibernate-core-3.6.6.Final.jar:3.6.6.Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906) [hibernate-entitymanager-3.6.6.Final.jar:3.6.6.Final]</span></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/619140#619140">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>