0
위해 나는 그런 예외가 내 응용 프로그램을 배포 한 후 :아직도 PersistenceException을 받고 : 없음 지속성 제공자를 EntityManager를
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named JavaAcademyUnit
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at com.bogdankobylinsky.javaacademy.dao.impl.jpa.UserJPADAO.<init>(UserJPADAO.java:13)
,이 라인에 실패
private EntityManager em = Persistence.createEntityManagerFactory("JavaAcademyUnit").createEntityManager();
JPA 구성 설명 persistance.xml을 파일의 위치는 입니다 ./WEB-INF/classes/META-INF/persistence.xml이며
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
<persistence-unit name="JavaAcademyUnit" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/__JavaAcademy</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
</persistence>
의 pom.xml 다음이 포함 어떤 도움
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
감사합니다!
이유물 폴더에 필요한 라이브러리와 루트에 lib 폴더 이 있어야합니다 :
그것을 희망