2013-02-13 62 views
0

我需要在weblogic容器中創建一個網站,但我不知道如何將jpa 2.0連接到jndi與spring的weblogic連接和管理。JPA 2.0 + SPRING 3.1 + Weblogic 10.3.5

現在我有一個項目,但有錯誤,在這種情況下我的文件設置爲:

<?xml version="1.0" encoding="UTF-8"?> 
<persistence version="2.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_2_0.xsd"> 
    <persistence-unit name="unitPU" transaction-type="JTA"> 
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> 
    <jta-data-source>jdbc/fact</jta-data-source> 
    <exclude-unlisted-classes>false</exclude-unlisted-classes> 
    <properties> 
     <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> 
    </properties> 
    </persistence-unit> 
</persistence> 

和錯誤是:

weblogic.deployment.EnvironmentException: Error processing persistence unit unitPU of module web: Error instantiating the Persistence Provider class org.eclipse.persistence.jpa.PersistenceProvider of the PersistenceUnit factory-web-copyPU: java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.PersistenceProvider 

任何樣本或任何主意,幫我解決了這個錯誤o創建一個項目jpa + spring + weblogic我會很棒

回答

0

你的類路徑中沒有類:org.eclipse.persistence.jpa.PersistenceProvider。這是什麼導致了例外。所以.jar文件包含這個類添加到您的類路徑,或者如果你使用Maven,添加這種依賴性:

<dependency> 
    <groupId>org.eclipse.persistence</groupId> 
    <artifactId>{artifact}</artifactId> 
    <version>{version}</version> 
    <scope>compile</scope> 
</dependency> 

,並指定相應的artifactId

參見: