0

weblogic コンテナーで Web サイトを作成する必要がありますが、jpa 2.0 を jndi weblogic 接続に接続し、Spring で管理する方法がわかりません。

今、私は 1 つのプロジェクトを持っていますが、エラーがあります。この場合、私のファイル設定は次のとおりです。

    <?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 を作成してください。

4

1 に答える 1

0

org.eclipse.persistence.jpa.PersistenceProviderclass:をクラスパスに持っていません。それが例外の原因です。したがって、.jarこのクラスを含むファイルをクラスパスに追加するか、Maven を使用している場合は次の依存関係を追加します。

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

適切な を指定しますartifactId

見る:

于 2013-02-13T21:45:36.723 に答える