我需要在weblogic容器中创建一个网站,但我不知道如何通过spring将jpa 2.0连接到jndi weblogic连接和管理。
现在我有一个项目但有错误,在这种情况下我的文件设置是:
<?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 :(得分: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
。
查看:强>