实例化持久性提供程序类java.lang.ClassNotFoundException时出错:org.hibernate.ejb.HibernatePersistence [英] Error instantiating Persistence Provider class java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence

查看:945
本文介绍了实例化持久性提供程序类java.lang.ClassNotFoundException时出错:org.hibernate.ejb.HibernatePersistence的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Weblogic:12.2.1上部署EJB应用程序时,我面临异常:

On deploying EJB application on Weblogic : 12.2.1 , I am facing the exception :

实例化持久性提供程序类org.hibernate.ejb.HibernatePersistence的错误PersistenceUnit entityManager:java.lang.ClassNotFoundException:org.hibernate.ejb.HibernatePersistence

"Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit entityManager: java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence"

我在persistence.xml中有以下配置来指定持久性提供程序

I have the below configuration in persistence.xml to specify persistence provider

<persistence-unit name="entityManager">
    <!-- Use Hibernate persistency -->  
    <provider>org.hibernate.ejb.HibernatePersistence</provider>

及以下weblogic-application.xml

and below in weblogic-application.xml

<prefer-application-packages>
    <package-name>antlr.*</package-name>
    <package-name>javax.persistence.*</package-name>
</prefer-application-packages>

我按照以下链接检查WL中设置的默认持久性提供程序,即TopLink。

I followed the below link to check default persistence provider set in WL , which is TopLink.

https://docs.oracle.com/middleware/1213/wls/WLACH/taskhelp/domainconfig/ConfigureDefaultJPAProvider.html

此外,尝试过使用hibernate-jpa-api.jar,slf4j-api.jar通过以下配置在setDomainEnv.cmd中设置classpath valriables并重新启动服务器。仍然面临同样的问题。

Also , tried to set classpath valriables in setDomainEnv.cmd with hibernate-jpa-api.jar, slf4j-api.jar by below configuration and restarted server .Still facing same issue.

set EXT_PRE_CLASSPATH=C:\Projects\...\lib\hibernate\hibernate-jpa-api.jar;C:\Projects\...\lib\hibernate\slf4j-api.jar


推荐答案

添加hibernate jar到weblogic域的lib文件夹可以工作,即hibernate.jar,hibernate-api.jar,javax.persistence.jar,com.oracle.jpa2support_ ar以及你在setDomainEnv.cmd的类路径中设置的那个

Adding the hibernate jars to the lib folder of weblogic domain can work ie hibernate.jar , hibernate-api.jar , javax.persistence.jar, com.oracle.jpa2support_ ar and the one's you set in the classpath of setDomainEnv.cmd

资料来源: - https://docs.oracle.com/cd/E12839_01/web.1111/e13706/classloading.htm #WLPRG324
https://community.oracle.com/thread/1065416

Source : -https://docs.oracle.com/cd/E12839_01/web.1111/e13706/classloading.htm#WLPRG324 and https://community.oracle.com/thread/1065416

这篇关于实例化持久性提供程序类java.lang.ClassNotFoundException时出错:org.hibernate.ejb.HibernatePersistence的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆