Fabio Schmitz Tani [http://community.jboss.org/people/fstani] created the 
discussion

"Re: JBOSS 5.1 Server -> org.hibernate.ejb.HibernatePersistence cannot be 
cast to javax.persistence.spi.PersistenceProvider"

To view the discussion, visit: http://community.jboss.org/message/563834#563834

--------------------------------------------------------------
Hello,

I've had similar problems, what I can tell you is that you can bundle your 
hibernate jars with your web application, and use a classloading configuration 
with jboss-web.xml to force JBoss to load jars from your application first, and 
then from common/lib, this way you can stop receiving this kinds of errors 
because of duplicate libraries that are bundled with JBoss.

The solution is documented here:
 http://community.jboss.org/docs/DOC-9288 
http://community.jboss.org/wiki/classloadingconfiguration

Here's the jist of it (jboss-web.xml inside your WAR WEB-INF folder)


<jboss-web>
   <class-loading java2ClassLoadingCompliance="false">
    <loader-repository>
        unique.packege.name:archive=your_project.war
        <loader-repository-config>
            java2ParentDelegation=false
        </loader-repository-config>
    </loader-repository>
   </class-loading>
</jboss-web>


With that you avoid conflicting problems, the one thing you might need is to 
update the hibernate-validator inside the common/lib, and unfortunately I 
wasn't able to get around this with this configuration. If no errors appear 
because of it, better for you, but if you get validation error messages, you 
will need to replace the current validator bundled with JBoss.

Best Regards,
Fabio
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/563834#563834]

Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to