I've just migrated from Tomcat to JBoss AS 7.
So, I configured Mysql datasource in JBoss (adding module.xml with associated Jar, adding driver bloc into standalone.xml and configuring datasource through JBoss interface.
No errors when deploying but impossible to get an entityManager (JPA with Hibernate in background).
Indeed, when this code is executed:
Persistence.createEntityManagerFactory("RoomManagement");
I obtain this error :
> javax.persistence.PersistenceException: No Persistence provider for
> EntityManager named RoomManagement
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
Very strange because I well verified that my persistence.xml does take place into War at WEB-INF/classes/META-INF directory.
My persistence.xml looks like as follow :
org.hibernate.ejb.HibernatePersistencejava:jboss/datasources/MySqlDScom.parisdescartes.roommanagement.domain.entities.Addresscom.parisdescartes.roommanagement.domain.entities.Buildingcom.parisdescartes.roommanagement.domain.entities.Civilitycom.parisdescartes.roommanagement.domain.entities.EventTypecom.parisdescartes.roommanagement.domain.entities.Jobcom.parisdescartes.roommanagement.domain.entities.Reservationcom.parisdescartes.roommanagement.domain.entities.Roomcom.parisdescartes.roommanagement.domain.entities.RoomTypecom.parisdescartes.roommanagement.domain.entities.Toolcom.parisdescartes.roommanagement.domain.entities.Usercom.parisdescartes.roommanagement.domain.entities.UserDetailcom.parisdescartes.roommanagement.domain.entities.Schedule
Did I make a mistake or forgot to specify something ?
以上就是No persistence provider found with JBoss AS 7的详细内容,更多请关注web前端其它相关文章!