0
지난 며칠 동안이 오류로 씨름하고 있습니다. 누군가 내가 잘못 가고 있다고 지적하십시오.EntityManager에 대한 지속성 공급자 없음 - 악의적 인 오류
eclipselink와 함께 JPA를 사용하려고합니다. 괜찮 았어. 지속성 공급자로 최대 절전 모드와 JPA와 동작을 확인하려면, 나는 persitence.xml을 변경하고 나는 "EntityManager의 이름 usinghibernate에 대한 어떠한 지속성 공급자"
내 persistence.xml을 악명 높은 오류가 발생하지 오전
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="usinghibernate">
<provider>org.hibernate.ejb.HibernatePeristence</provider>
<class>arun.ucerelay.datastructures.XVMUpdateProfile</class>
<class>arun.ucerelay.datastructures.XVMUpdateProfileItem</class>
<!-- Scan for annotated classes and Hibernate mapping XML files -->
<properties>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:krsna"/>
<property name="hibernate.connection.username" value="scott"/>
<property name="hibernate.connection.password" value="tiger"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>
자바 프로그램 : 여기
public static void main(String args[]) {
try {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("usinghibernate");
// First unit of work
EntityManager em = emf.createEntityManager();
...
...
내가 최대 절전 모드 항아리를 얻기 위해 무슨 짓 :이 META-INF/persistence.xml을하고 퍼시스턴스 유닛을 찾을 수 있음을 로그에
...
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.2</version>
</dependency>
...
, 그 명확하고 다시는이를 찾을 수 나던 불평 :나는 받는다는의 pom.xml 2 종속성을 포함 지속성 단위.
TRACE 2011-02-26 00:50:31,765 [main](PersistenceXmlLoader.java:112) org.hibernate.ejb.packaging.PersistenceXmlLoader - Validate with persistence_2_0.xsd schema on file file:/C:/arun/eclipse/workspace/practicewitheclipselink/target/classes/META-INF/persistence.xml
TRACE 2011-02-26 00:50:31,781 [main](PersistenceXmlLoader.java:117) org.hibernate.ejb.packaging.PersistenceXmlLoader - Found error with persistence_2_0.xsd schema on file file:/C:/arun/eclipse/workspace/practicewitheclipselink/target/classes/META-INF/persistence.xml
TRACE 2011-02-26 00:50:31,781 [main](PersistenceXmlLoader.java:127) org.hibernate.ejb.packaging.PersistenceXmlLoader - Validate with persistence_1_0.xsd schema on file file:/C:/arun/eclipse/workspace/practicewitheclipselink/target/classes/META-INF/persistence.xml
TRACE 2011-02-26 00:50:31,781 [main](PersistenceXmlLoader.java:239) org.hibernate.ejb.packaging.PersistenceXmlLoader - Persistent Unit name from persistence.xml: usinghibernate
TRACE 2011-02-26 00:50:31,781 [main](Ejb3Configuration.java:321) org.hibernate.ejb.Ejb3Configuration - PersistenceMetadata(version=1.0) [
name: usinghibernate
jtaDataSource: null
nonJtaDataSource: null
transactionType: RESOURCE_LOCAL
provider: org.hibernate.ejb.HibernatePeristence
useQuotedIdentifiers: false
classes[
arun.ucerelay.datastructures.XVMUpdateProfile arun.ucerelay.datastructures.XVMUpdateProfileItem ]
packages[
]
mappingFiles[
]
jarFiles[
]
hbmfiles: 0
properties[
hibernate.connection.username: scott
hibernate.connection.password: tiger
hibernate.dialect: org.hibernate.dialect.OracleDialect
hibernate.show_sql: true
hibernate.connection.url: jdbc:oracle:thin:@localhost:1521:krsna
hibernate.connection.driver_class: oracle.jdbc.driver.OracleDriver
]]
Feb 26, 2011 12:50:31 AM UpdateProfileMain main
WARNING: Arun Could not load profiles : No Persistence provider for EntityManager named usinghibernate
Feb 26, 2011 12:50:31 AM UpdateProfileMain main
WARNING: Arun Could not load profiles : null
으로 교체해야합니다. 고맙습니다. –