PersistenceProvider org.hibernate.ejb.HibernatePersistence not found -


I get the following exception when deploying my EJB ER in the server JBoss7.1 P>

  By: javax.preistence.PersistenceException: JBAS011466: PersistenceProvider 'org.hibernate.ejb.HibernatePersistence' not found  

join me with me The following jars are EJB (this also lives inside my jboss module jboss_home / modules / org / hibernate / main ):

  Hibernate-commons-annotation 4.0. 1.final jar hibernate-core-4.0.1.final Hibernate-Unit Manager-4.0.1. Finish Hibernate-Infinisan-4.0.1.funal.jpg How I added my hierarch provider on my  persistence.xml  file: 

 < Code> & lt; Persistence xmlns = "http://java.sun.com/xml/ns/preistence" xmlns: Xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schema location = "http: / /java.sun.com/xml/ns/pressistence http://java.sun.com/xml / ns / persistence / persis tence_2_0.xsd "version =" 2.0 "& gt; & Lt; Persistence unit name = "hbPU" transaction-type = "RESOURCE_LOCAL" & gt; & Lt; Provider & gt; Org.hibernate.ejb.HibernatePersistence & lt; / Provider & gt; ... & lt; / Firm-unit & gt; & Lt; / Persistence>  

I tried to do this ... Java Class Hibernate Create Java and Persistence Unit Name entityManagerFactory = Persistence .createEntityManagerFactory ("ABC");

  Public Square HibernateUtil {Personal Static Final EntityManagerFactory entityManagerFactory; Static {try} {entityManagerFactory = persistence.createEntityManagerFactory ("HbPu"); // Here is your firmness unit name system.out.println ("Unit Manager Test .............." + entityManagerFactory); } Catch (Throttle Pre) {System.err.println ("Initial Session. Factoring Failure." + East); New ExceptionInInitializerError (ex) Throw; }} Public Fixed Unit EntityManagerFactory getEntityManagerFactory () {Return Entity ManagerFactory; }}  

and thus create your persistence.xml

  & lt; Persistence version = "2.0" xmlns = "http: //java.sun com / xml / ns / persistence" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schema location = "Http://java.sun.com/xml/ns/pressistence http: //java.sun.com/xml/ns/persistence/persistence_2_0.xsd" & gt; & Lt; Persistence unit name = "hbPU" transaction-type = "RESOURCE_LOCAL" & gt; & Lt; Provider & gt; Org.hibernate.ejb.HibernatePersistence & lt; / Provider & gt; & Lt ;! - Map your classes - & gt; & Lt; Properties & gt; & Lt; Property Name = "javax.persistence.jdbc.driver" value = "xxx" /> & Lt; Property Name = "javax.persistence.jdbc.url" value = "xxx" /> & Lt; Property Name = "javax.persistence.jdbc.user" value = "xxx" /> & Lt; Property Name = "javax.persistence.jdbc.password" value = "xxx" /> & Lt; Property Name = "hibernate.dialect" value = "org.hibernate.dialect.MySQLDialect" /> & Lt; Property Name = "hibernate.hbm2ddl.auto" value = "create-drop" /> & Lt; Property Name = "hibernate.show_sql" value = "true" /> & Lt; / Properties & gt; & Lt; / Persistence unit & gt; & Lt; / Persistence>  

Your error will not come ...


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -