1

I am trying to deploy the product in JBOSS AS 5.1.0 GA using eclipse in Linux.

Previously it was executed successfully on tomcat 6. While deploying I got many errors. I had solved one by one.

But now ClassNotFoundException raised due to the PersistenceProvider.

My product environment is JPA 1.0. and I am using toplink-essentials.jar, toplink-essentials-agent.jar. (my toplink version is 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.

While in execution time jboss is loading the both jars. (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".

But i had set the parent-first="false" in my jboss-classloading.xml

below code is in my /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

 <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.

(For detail decription for persistence.xml and list of all jars, please see the Jboss community link)

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)

4

1 回答 1

1

当我删除persistence.xml<provider>中标签之间的空格时,上述问题已经解决,如下所示。

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

于 2013-04-26T11:01:47.227 回答