简体   繁体   English

在JBOSS AS 5.1.0 GA中找不到PersistenceProvider异常

[英]PersistenceProvider not found Exception in JBOSS AS 5.1.0 GA

I am trying to deploy the product in JBOSS AS 5.1.0 GA using eclipse in Linux. 我正在尝试使用Linux中的Eclipse在JBOSS AS 5.1.0 GA中部署产品。

Previously it was executed successfully on tomcat 6. While deploying I got many errors. 以前它是在tomcat 6上成功执行的。在部署过程中,我遇到很多错误。 I had solved one by one. 我已经一一解决了。

But now ClassNotFoundException raised due to the PersistenceProvider. 但是现在由于PersistenceProvider引发了ClassNotFoundException。

My product environment is JPA 1.0. 我的产品环境是JPA 1.0。 and I am using toplink-essentials.jar, toplink-essentials-agent.jar. 我正在使用toplink-essentials.jar,toplink-essentials-agent.jar。 (my toplink version is 2.0) (我的toplink版本是2.0)

Please see the bug decription... 请参阅错误说明...

11:46:08,276 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#Entity state=Create java.lang.ClassNotFoundException: oracle.toplink.essentials.PersistenceProvider from BaseClassLoader@12bb617{VFSClassLoaderPolicy@bfa9d6{name=vfsfile:/opt/jboss-5.1.0.GA/server/default/deploy/iportman_gpl.war/ domain=ClassLoaderDomain@16877f8{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@1837697} roots=[MemoryContextHandler@19344978[path= context=vfsmemory://3j011-idx41v-hfxjen4j-1-hfxjf9qd-2a real=vfsmemory://3j011-idx41v-hfxjen4j-1-hfxjf9qd-2a], FileHandler@22157425[path=iportman_gpl.war/WEB-INF/classes context=file:/opt/jboss-5.1.0.GA/server/default/deploy/ real=file:/opt/jboss-5.1.0.GA/server/default/deploy/iportman_gpl.war/WEB-INF/classes/]

This is the only bug showing while I am trying to deploy my project which is a WAR file. 这是我尝试部署WAR文件的项目时显示的唯一错误。

While in execution time jboss is loading the both jars. 在执行时,jboss正在加载两个jar。 (toplink-essentials.jar, toplink-essentials-agent.jar). (toplink-essentials.jar,toplink-essentials-agent.jar)。 (This is also showing on error console) (这也在错误控制台上显示)

DelegatingHandler@13596360[path=iportman_gpl.war/WEB-INF/lib/toplink-essentials.jar context=file:/opt/jboss-5.1.0.GA/server/default/deploy/ real=file:/opt/jboss-5.1.0.GA/server/default/deploy/iportman_gpl.war/WEB-INF/lib/toplink-essentials.jar] DelegatingHandler@32401617[path=iportman_gpl.war/WEB-INF/lib/toplink-essentials-agent.jar context=file:/opt/jboss-5.1.0.GA/server/default/deploy/ real=file:/opt/jboss-5.1.0.GA/server/default/deploy/iportman_gpl.war/WEB-INF/lib/toplink-essentials-agent.jar]

but still it is showing the error. 但仍然显示错误。

When I had Google about this issue then i had seen some explanations like.. "may be it is loading two PersistenceProvider classes or jboss also loading their JPA classes". 当我让Google讨论此问题时,我看到了一些解释,例如:“可能是正在加载两个PersistenceProvider类,或者jboss也正在加载其JPA类”。

But i had set the parent-first="false" in my jboss-classloading.xml 但是我在jboss-classloading.xml中设置了parent-first =“ false”

below code is in my /WEB-INF/jboss-classloading.xml 下面的代码在我的/WEB-INF/jboss-classloading.xml中

<?xml version="1.0" encoding="UTF-8"?>
<classloading xmlns="urn:jboss:classloading:1.0"
export-all="NON_EMPTY"
import-all="true"
parent-first="false">
</classloading>

I also declared the below code in my /WEB-INF/classes/META-INF/ persistence.xml 我还在/ WEB-INF / classes / META-INF / persistence.xml中声明了以下代码

 <persistence-unit name="Entity" transaction-type="RESOURCE_LOCAL">
 <provider>oracle.toplink.essentials.PersistenceProvider</provider>

Please help me to solve the problem. 请帮我解决问题。 I posted the same issue in JBOSS community for their help, but i did not get any response. 我在JBOSS社区中发布了相同的问题,以寻求他们的帮助,但没有得到任何回应。

(For detail decription for persistence.xml and list of all jars, please see the Jboss community link ) (有关persistence.xml的详细说明以及所有jar的列表,请参阅Jboss社区链接

So, Anyone help me to find out problem. 因此,任何人都可以帮助我找出问题所在。 Any suggestions will be a greatly helpful to me... Thanks in Advance.. 任何建议对我都会有很大的帮助。

(Sorry for my bad English) (对不起,我的英语不好)

当我如下删除persistence.xml中 <provider>标记之间的空白时,上述问题就解决了。

<provider>oracle.toplink.essentials.PersistenceProvider</provider>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM