Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Exception when using EclipseLink JPA in OC4J 10.1.3.4
Exception when using EclipseLink JPA in OC4J 10.1.3.4 [message #390592] Fri, 24 July 2009 16:03 Go to next message
Yvon Lavoie is currently offline Yvon Lavoie
Messages: 1
Registered: July 2009
Junior Member
I'm trying to migrate a Web based JPA application from TopLink Essentials
to EclipseLink 1.1.2. I'm using Spring to configure the
EntityManagerFactory:

<bean id="entityManagerFactory"
class=" org.springframework.orm.jpa.LocalContainerEntityManagerFacto ryBean "
p:dataSource-ref="dataSource" >
<property name="jpaVendorAdapter">
<bean
class=" org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapt er "
p:databasePlatform="ORACLE" p:showSql="true"/>
</property>
<property name="persistenceUnitName" value="DataBridging" />
</bean>

I tested my application changes with both JUnit and within JDeveloper and
everything works fine. However, am I unable to deploy the application EAR
file to an OC4J container. I followed the instructions in the web tutorial:

http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tu torial#Option_1:_Add_an_eclipselink_shared-library_to_OC4J_- _recommended

I tried Option 1 which is the recommended option where I substituted the
eclipselink.jar file for the toplink-essentials.jar file in the
$OC4J_HOME/config/server.xml. After making the change and attempting to
deploy my EAR file, I now get the following error in the OPMN log file:

09/07/17 16:04:19 WARNING: DeployerRunnable.run
DataBridging:DataBridgingWeb - Exception creating EntityManagerFactory
using PersistenceProvider class
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der for
persistence unit
DataBridging.oracle.oc4j.admin.internal.DeployerException:
DataBridging:DataBridgingWeb - Exception creating EntityManagerFactory
using PersistenceProvider class
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der for
persistence unit DataBridging.
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase .java:126)


It appears that the TopLink Essentials EntityManagerFactory is being used
instead of the EclipseLink EntityManagerFactory.

I got the same error when trying Option #2. I am deploying the application
to a separate application server called "BRTK" than the default "home" so
I'm not sure if that is the cause of the error. My OC4J home is
/j2ee/BRTK/. I have this setup because I need to support multiple
applications and the legacy apps in the other app servers may still be
using TopLink Essentials. I only modified the files in the "BRTK" app
server.

Yvon
Re: Exception when using EclipseLink JPA in OC4J 10.1.3.4 [message #390593 is a reply to message #390592] Fri, 24 July 2009 18:47 Go to previous messageGo to next message
Michael OBrien is currently offline Michael OBrien
Messages: 34
Registered: July 2009
Member
Yvon,
Hi, verify that your persistence-unit provider is explicitly set to
org.eclipse.persistence.jpa.PersistenceProvider. It may have defaulted to
essentials in the past if left out as is the case on GlassFish with
TopLink Essentials.

See:
http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tu torial#Persistence.xml

<persistence version="1.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_1_0.xsd">
<persistence-unit name="DataBridging" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider >
...

thank you
/michael
Re: Exception when using EclipseLink JPA in OC4J 10.1.3.4 [message #390595 is a reply to message #390592] Mon, 27 July 2009 15:19 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Hey Yvon,
are you "the" Yvon Lavoie?


James : Wiki : Book : Blog : Twitter
Previous Topic:Performaces
Next Topic:Data row initialization for DataBase Table
Goto Forum:
  


Current Time: Tue Sep 30 17:52:51 GMT 2014

Powered by FUDForum. Page generated in 0.01884 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software