6 Replies Latest reply: Jun 11, 2012 10:49 AM by User738616-Oracle RSS

    JPA on the Grid

    praveen435
      Hi,

      I am trying to do oracle with coherence.My objective is to put data in to the database using toplink grid and again trying to retrieve data even when database is OFF. Because the data is updated in to the cache.I am following the link http://docs.oracle.com/cd/E17904_01/doc.1111/e16596/configjpa.htm.I am trying to implement 2.3 section in the above link. So i am using Hr schema in the database.I am using eclipse IDE.I created entity class using option "Create entities from tables".
      My entity class is as follows.
      Region.java

      package com;

      import java.io.Serializable;
      import javax.persistence.*;

      import org.eclipse.persistence.annotations.Customizer;

      import oracle.eclipselink.coherence.integrated.config.GridCacheCustomizer;


      /**
      * The persistent class for the REGIONS database table.
      *
      */
      @Entity
      @Table(name="REGIONS")
      @Customizer(GridCacheCustomizer.class)
      public class Region implements Serializable {
           private static final long serialVersionUID = 1L;

           @Id
           @Column(name="REGION_ID")
           private long regionId;

           @Column(name="REGION_NAME")
           private String regionName;

      public Region() {
      }

           public long getRegionId() {
                return this.regionId;
           }

           public void setRegionId(long regionId) {
                this.regionId = regionId;
           }

           public String getRegionName() {
                return this.regionName;
           }

           public void setRegionName(String regionName) {
                this.regionName = regionName;
           }

      }

      Persistance.xml

      <?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="SimpleCoherenceApp" transaction-type="RESOURCE_LOCAL">
                <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                <class>com.Region</class>
                <properties>
                     <property name="eclipselink.target-server" value="WebLogic_10"/>
                     <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
                     <property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
                     <property name="javax.persistence.jdbc.user" value="hr"/>
                     <property name="javax.persistence.jdbc.password" value="hr"/>
                     <property name="eclipselink.logging.level" value="FINEST"/>
                     <property name="eclipselink.cache.type.default" value="Full"/>
                </properties>
           </persistence-unit>
      </persistence>

      coherence-cache-config.xml

      <?xml version="1.0"?>
      <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
      <cache-config>
           <caching-scheme-mapping>
      <cache-mapping>
      <cache-name>*</cache-name>
      <scheme-name>eclipselink-distributed</scheme-name>
      </cache-mapping>
      </caching-scheme-mapping>
      <caching-schemes>
      <distributed-scheme>
      <scheme-name>eclipselink-distributed</scheme-name>
      <service-name>EclipseLinkJPA</service-name>
      <!--
      Configure a wrapper serializer to support serialization of relationships.
      -->

      <!-- <serializer>
      <class-name>oracle.eclipselink.coherence.integrated.cache.WrapperSerializer</class-name>
      <instance>

      <class-name>oracle.eclipselink.coherence.integrated.cache.WrapperSerializer</class-name>
      <init-params></init-params>

      </instance>
      </serializer> -->

      <backing-map-scheme>
      <!--
      Backing map scheme with no eviction policy.
      -->
      <local-scheme>

      </local-scheme>
      </backing-map-scheme>

      <autostart>true</autostart>
      </distributed-scheme>
      </caching-schemes>
      </cache-config>

      Now the main class is as follows:

      Manager.java
      package com;

      import javax.persistence.EntityManager;
      import javax.persistence.EntityManagerFactory;
      import javax.persistence.Persistence;

      public class Manager {

           /**
           * @param args
           */
           public static void main(String[] args)
           {
                EntityManagerFactory emf=Persistence.createEntityManagerFactory("SimpleCoherenceApp");
                EntityManager em=emf.createEntityManager();
                em.getTransaction().begin();
                Region R = new Region();
                R.setRegionId(9);
                R.setRegionName("Africa");
                em.persist(R);
                em.getTransaction().commit();

           }

      }


      The data is not inserting in to the database.My console is as follows:

      [EL Finest]: 2012-06-07 20:06:13.451--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Begin predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Initial; factoryCount 0
      [EL Finest]: 2012-06-07 20:06:13.708--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.orm.throw.exceptions; default value=true
      [EL Finest]: 2012-06-07 20:06:13.708--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.multitenant.tenants-share-emf; default value=true
      [EL Finest]: 2012-06-07 20:06:13.708--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.multitenant.tenants-share-cache; default value=false
      [EL Finest]: 2012-06-07 20:06:13.725--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.metadata-source; default value=null
      [EL Finer]: 2012-06-07 20:06:13.728--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Searching for default mapping file in file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/
      [EL Finer]: 2012-06-07 20:06:13.732--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Searching for default mapping file in file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/
      [EL Config]: 2012-06-07 20:06:13.866--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--The access type for the persistent class [class com.Region] is set to [FIELD].
      [EL Config]: 2012-06-07 20:06:13.904--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--The alias name for the entity class [class com.Region] is being defaulted to: Region.
      [EL Finest]: 2012-06-07 20:06:13.963--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--End predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 0
      [EL Finer]: 2012-06-07 20:06:13.964--Thread(Thread[Main Thread,5,main])--JavaSECMPInitializer - transformer is null.
      [EL Finest]: 2012-06-07 20:06:13.964--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Begin predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 0
      [EL Finest]: 2012-06-07 20:06:13.964--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--End predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 1
      [EL Finest]: 2012-06-07 20:06:13.979--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Begin deploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 1
      [EL Finer]: 2012-06-07 20:06:14.005--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory
      [EL Finest]: 2012-06-07 20:06:14.015--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.target-server; value=WebLogic_10; translated value=org.eclipse.persistence.platform.server.wls.WebLogic_10_Platform
      [EL Finest]: 2012-06-07 20:06:14.015--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
      [EL Finest]: 2012-06-07 20:06:14.015--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
      [EL Finest]: 2012-06-07 20:06:14.017--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=javax.persistence.jdbc.user; value=hr
      [EL Finest]: 2012-06-07 20:06:14.017--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=javax.persistence.jdbc.password; value=xxxxxx
      [EL Finest]: 2012-06-07 20:06:14.741--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=javax.persistence.jdbc.driver; value=oracle.jdbc.OracleDriver
      [EL Finest]: 2012-06-07 20:06:14.741--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=javax.persistence.jdbc.url; value=jdbc:oracle:thin:@localhost:1521:xe
      [EL Finest]: 2012-06-07 20:06:14.749--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--property=eclipselink.cache.type.default; value=Full; translated value=org.eclipse.persistence.internal.identitymaps.FullIdentityMap
      [EL Info]: 2012-06-07 20:06:14.763--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.3.2.v20111125-r10461
      [EL Warning]: 2012-06-07 20:06:14.764--Thread(Thread[Main Thread,5,main])--java.lang.ClassNotFoundException: weblogic.version
           at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:169)
           at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:107)
           at org.eclipse.persistence.platform.server.wls.WebLogicPlatform.initializeServerNameAndVersion(WebLogicPlatform.java:86)
           at org.eclipse.persistence.platform.server.ServerPlatformBase.getServerNameAndVersion(ServerPlatformBase.java:181)
           at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:661)
           at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
           at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:488)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
           at com.Manager.main(Manager.java:15)

      [EL Finest]: 2012-06-07 20:06:15.175--Thread(Thread[Main Thread,5,main])--Database platform: org.eclipse.persistence.platform.database.oracle.Oracle11Platform, regular expression: (?i)oracle.*11
      [EL Finest]: 2012-06-07 20:06:15.178--Thread(Thread[Main Thread,5,main])--Database platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform, regular expression: (?i)oracle.*10
      [EL Fine]: 2012-06-07 20:06:15.178--Thread(Thread[Main Thread,5,main])--Detected database platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform
      [EL Config]: 2012-06-07 20:06:15.203--ServerSession(34841853)--Connection(37577244)--Thread(Thread[Main Thread,5,main])--connecting(DatabaseLogin(
           platform=>Oracle10Platform
           user name=> "hr"
           datasource URL=> "jdbc:oracle:thin:@localhost:1521:xe"
      ))
      [EL Config]: 2012-06-07 20:06:15.217--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:xe
           User: HR
           Database: Oracle Version: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
           Driver: Oracle JDBC driver Version: 10.2.0.1.0XE
      [EL Finest]: 2012-06-07 20:06:15.22--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connection acquired from connection pool [default].
      [EL Finest]: 2012-06-07 20:06:15.221--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connection released to connection pool [default].
      [EL Info]: 2012-06-07 20:06:15.346--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp login successful
      [EL Warning]: 2012-06-07 20:06:15.363--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
      [EL Warning]: 2012-06-07 20:06:15.365--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
      [EL Warning]: 2012-06-07 20:06:15.365--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
      [EL Finest]: 2012-06-07 20:06:15.366--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--The applicationName for the MBean attached to session [file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp] is [unknown]
      [EL Finest]: 2012-06-07 20:06:15.366--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--The moduleName for the MBean attached to session [file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp] is [unknown]
      [EL Finer]: 2012-06-07 20:06:15.402--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--Canonical Metamodel class [com.Region_] not found during initialization.
      [EL Finest]: 2012-06-07 20:06:15.402--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--End deploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Deployed; factoryCount 1
      [EL Finer]: 2012-06-07 20:06:15.422--ServerSession(34841853)--Thread(Thread[Main Thread,5,main])--client acquired: 33723171
      [EL Finer]: 2012-06-07 20:06:15.433--ClientSession(33723171)--Thread(Thread[Main Thread,5,main])--acquire unit of work: 33613802
      [EL Finest]: 2012-06-07 20:06:15.437--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--persist() operation called on: com.Region@200eb1e.
      [EL Finer]: 2012-06-07 20:06:15.448--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--begin unit of work commit
      [EL Finest]: 2012-06-07 20:06:15.492--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--Execute query InsertObjectQuery(com.Region@200eb1e)
      [EL Finest]: 2012-06-07 20:06:15.506--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connection acquired from connection pool [default].
      [EL Finer]: 2012-06-07 20:06:15.508--ClientSession(33723171)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--begin transaction
      [EL Fine]: 2012-06-07 20:06:15.516--ClientSession(33723171)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--INSERT INTO REGIONS (REGION_ID, REGION_NAME) VALUES (?, ?)
           bind => [9, Africa]
      2012-06-07 20:06:15.896/3.638 Oracle Coherence 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Loaded operational configuration from "jar:file:/C:/Oracle/Middleware10.3.4.0/coherence_3.6/lib/coherence.jar!/tangosol-coherence.xml"
      2012-06-07 20:06:15.906/3.647 Oracle Coherence 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Loaded operational overrides from "jar:file:/C:/Oracle/Middleware10.3.4.0/coherence_3.6/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
      2012-06-07 20:06:15.907/3.648 Oracle Coherence 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Loaded operational overrides from "file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/tangosol-coherence-override.xml"
      2012-06-07 20:06:15.910/3.651 Oracle Coherence 3.6.0.4 <D5> (thread=Main Thread, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

      Oracle Coherence Version 3.6.0.4 Build 19111
      Grid Edition: Development mode
      Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

      2012-06-07 20:06:16.063/3.804 Oracle Coherence GE 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Loaded cache configuration from "file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/coherence-cache-config.xml"
      2012-06-07 20:06:17.158/4.899 Oracle Coherence GE 3.6.0.4 <D4> (thread=Main Thread, member=n/a): TCMP bound to /172.16.30.150:8090 using SystemSocketProvider
      2012-06-07 20:06:17.818/5.559 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): Failed to satisfy the variance: allowed=16, actual=34
      2012-06-07 20:06:17.819/5.560 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): Increasing allowable variance to 18
      2012-06-07 20:06:18.054/5.795 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): This Member(Id=3, Timestamp=2012-06-07 20:06:17.821, Address=172.16.30.150:8090, MachineId=41622, Location=machine:Praveen-PC,process:316, Role=ManagerManager, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "cluster:0xC4DB" with senior Member(Id=1, Timestamp=2012-06-07 16:51:43.007, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:2836, Role=CoherenceConsole, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)
      2012-06-07 20:06:18.098/5.839 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Cluster with senior member 1
      2012-06-07 20:06:18.099/5.840 Oracle Coherence GE 3.6.0.4 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
      2012-06-07 20:06:18.109/5.850 Oracle Coherence GE 3.6.0.4 <Info> (thread=Main Thread, member=n/a): Started cluster Name=cluster:0xC4DB

      Group{Address=224.3.6.0, Port=36000, TTL=4}

      MasterMemberSet
      (
      ThisMember=Member(Id=3, Timestamp=2012-06-07 20:06:17.821, Address=172.16.30.150:8090, MachineId=41622, Location=machine:Praveen-PC,process:316, Role=ManagerManager)
      OldestMember=Member(Id=1, Timestamp=2012-06-07 16:51:43.007, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:2836, Role=CoherenceConsole)
      ActualMemberSet=MemberSet(Size=2, BitSetCount=2
      Member(Id=1, Timestamp=2012-06-07 16:51:43.007, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:2836, Role=CoherenceConsole)
      Member(Id=3, Timestamp=2012-06-07 20:06:17.821, Address=172.16.30.150:8090, MachineId=41622, Location=machine:Praveen-PC,process:316, Role=ManagerManager)
      )
      RecycleMillis=1200000
      RecycleSet=MemberSet(Size=0, BitSetCount=0
      )
      )

      TcpRing{Connections=[1]}
      IpMonitor{AddressListSize=0}

      2012-06-07 20:06:18.189/5.930 Oracle Coherence GE 3.6.0.4 <D5> (thread=Invocation:Management, member=3): Service Management joined the cluster with senior service member 1
      2012-06-07 20:06:18.394/6.135 Oracle Coherence GE 3.6.0.4 <D5> (thread=DistributedCache:EclipseLinkJPA, member=3): Service EclipseLinkJPA joined the cluster with senior service member 3
      [EL Finer]: 2012-06-07 20:06:18.538--ClientSession(33723171)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--rollback transaction
      [EL Finest]: 2012-06-07 20:06:18.541--ServerSession(34841853)--Connection(37580294)--Thread(Thread[Main Thread,5,main])--Connection released to connection pool [default].
      [EL Warning]: 2012-06-07 20:06:18.542--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--Local Exception Stack:
      Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
      Exception Description: Identity map constructor failed because an invalid identity map was specified.
      Internal Exception: java.lang.reflect.InvocationTargetException
      Target Invocation Exception: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
      Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
           at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:838)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:392)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:346)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:950)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:175)
           at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
           at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:421)
           at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:272)
           at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1623)
           at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1588)
           at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:275)
           at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
           at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
           at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
           at com.Manager.main(Manager.java:21)
      Caused by: java.lang.reflect.InvocationTargetException
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
           at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeConstructor(PrivilegedAccessHelper.java:382)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:387)
           ... 13 more
      Caused by: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
           at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.generateWrapper(WrapperGenerator.java:104)
           at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.createWrapperFor(WrapperGenerator.java:96)
           at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.defineWrapperClass(CoherenceCacheHelper.java:573)
           at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.initializeForDescriptor(CoherenceCacheHelper.java:304)
           at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:241)
           at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
           ... 19 more

      [EL Finer]: 2012-06-07 20:06:18.549--UnitOfWork(33613802)--Thread(Thread[Main Thread,5,main])--release unit of work
      [EL Finer]: 2012-06-07 20:06:18.55--ClientSession(33723171)--Thread(Thread[Main Thread,5,main])--client released
      Exception in thread "Main Thread" javax.persistence.RollbackException: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
      Exception Description: Identity map constructor failed because an invalid identity map was specified.
      Internal Exception: java.lang.reflect.InvocationTargetException
      Target Invocation Exception: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
      Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
           at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
           at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
           at com.Manager.main(Manager.java:23)
      Caused by: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
      Exception Description: Identity map constructor failed because an invalid identity map was specified.
      Internal Exception: java.lang.reflect.InvocationTargetException
      Target Invocation Exception: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
      Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
           at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:838)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:392)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:346)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:950)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:175)
           at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
           at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:421)
           at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:272)
           at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1623)
           at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1588)
           at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:275)
           at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
           at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
           at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
           at com.Manager.main(Manager.java:21)
      Caused by: java.lang.reflect.InvocationTargetException
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
           at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeConstructor(PrivilegedAccessHelper.java:382)
           at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:387)
           ... 13 more
      Caused by: java.lang.NoSuchMethodError: org/eclipse/persistence/internal/libraries/asm/ClassWriter.<init>(Z)V
           at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.generateWrapper(WrapperGenerator.java:104)
           at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.createWrapperFor(WrapperGenerator.java:96)
           at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.defineWrapperClass(CoherenceCacheHelper.java:573)
           at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.initializeForDescriptor(CoherenceCacheHelper.java:304)
           at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:241)
           at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
           ... 19 more


      So, any suggestions would be great.

      Regards,
      Praveen
        • 1. Re: JPA on the Grid
          User738616-Oracle
          Hi Praveen,

          You are missing the jars in your classpath. Make sure you have following jars in your classpath:

          - coherence.jar
          - coherence-jpa.jar
          - JDBC driver jar
          - toplink-grid.jar
          - eclipselink.jar
          - javax.persistence_xx.jar

          Hope this helps!

          Cheers,
          NJ
          • 2. Re: JPA on the Grid
            praveen435
            HI NJ,
            Thanks for the reply.The jars you mentioned are already on my classpath.when i removed the annotation(@Customizer(GridCacheCustomizer.class)) in the entity class,the data is inserting in to the database.when i used this annotation,I am getting the above error.one more thing,i am getting error at the <serializer> element in the coherence-cache-config.xml.

            coherence-cache-config.xml

            <?xml version="1.0"?>
            <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
            <cache-config>
                 <caching-scheme-mapping>
            <cache-mapping>
            <cache-name>*</cache-name>
            <scheme-name>eclipselink-distributed</scheme-name>
            </cache-mapping>
            </caching-scheme-mapping>
            <caching-schemes>
            <distributed-scheme>
            <scheme-name>eclipselink-distributed</scheme-name>
            <service-name>EclipseLinkJPA</service-name>
            <!--
            Configure a wrapper serializer to support serialization of relationships.
            -->
            *<serializer>*
            *<class-name>oracle.eclipselink.coherence.integrated.cache.WrapperSerializer</class-name>*
            *</serializer>*
            <backing-map-scheme>
            <!--
            Backing map scheme with no eviction policy.
            -->
            <local-scheme>
            <scheme-name>unlimited-backing-map</scheme-name>
            </local-scheme>
            </backing-map-scheme>

            <autostart>true</autostart>
            </distributed-scheme>
            </caching-schemes>
            </cache-config>


            Regards,
            Praveen
            • 3. Re: JPA on the Grid
              User738616-Oracle
              Hi Praveen,
              HI NJ,
              Thanks for the reply.The jars you mentioned are already on my classpath.when i removed the annotation(@Customizer(GridCacheCustomizer.class)) in the entity class,the data is inserting in to the database.when i used this annotation,I am getting the above error.one more thing,i am getting error at the <serializer> element in the coherence-cache-config.xml.

              coherence-cache-config.xml

              <?xml version="1.0"?>
              <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
              <cache-config>
                   <caching-scheme-mapping>
              <cache-mapping>
              <cache-name>*</cache-name>
              <scheme-name>eclipselink-distributed</scheme-name>
              </cache-mapping>
              </caching-scheme-mapping>
              <caching-schemes>
              <distributed-scheme>
              <scheme-name>eclipselink-distributed</scheme-name>
              <service-name>EclipseLinkJPA</service-name>
              <!--
              Configure a wrapper serializer to support serialization of relationships.
              -->
              *<serializer>*
              *<class-name>oracle.eclipselink.coherence.integrated.cache.WrapperSerializer</class-name>*
              *</serializer>*
              <backing-map-scheme>
              <!--
              Backing map scheme with no eviction policy.
              -->
              <local-scheme>
              <scheme-name>unlimited-backing-map</scheme-name>
              </local-scheme>
              </backing-map-scheme>

              <autostart>true</autostart>
              </distributed-scheme>
              </caching-schemes>
              </cache-config>


              Regards,
              Praveen
              If you have the right jars in the classpath, you should not have issues using the <serializer>. What are issues you are facing? If you don't configure (@Customizer(GridCacheCustomizer.class), then L2 caching will be disabled. You can also use @CacheInterceptor(value = CoherenceInterceptor.class)

              Hope this helps!

              Cheers,
              NJ
              • 4. Re: JPA on the Grid
                praveen435
                Hi NJ,

                I am getting error in the serializer element in coherence-cache-config.xml.It is saying that *"The content of Element type "serializer" must match (instance) "*.Even i tried by putting @CacheInterceptor(value = CoherenceInterceptor.class) in the entity class.Still facing the error in the serializer element.Is it mandatory to have serializer element in the caherence-cache-config.xml?


                Regards,
                Praveen
                • 5. Re: JPA on the Grid
                  praveen435
                  HI NJ,

                  when i am using @Customizer(GridCacheCustomizer.class) in the entity class,the data is not at all inserting in to the database.So if i commented this annotation,the data is inserting in to the database.The console is showing as follows:

                  [EL Finest]: 2012-06-11 14:30:27.803--ServerSession(30146205)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Initial; factoryCount 0
                  [EL Finest]: 2012-06-11 14:30:27.819--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.orm.throw.exceptions; default value=true
                  [EL Finest]: 2012-06-11 14:30:27.82--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.multitenant.tenants-share-emf; default value=true
                  [EL Finest]: 2012-06-11 14:30:27.82--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.multitenant.tenants-share-cache; default value=false
                  [EL Finest]: 2012-06-11 14:30:27.836--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.metadata-source; default value=null
                  [EL Finer]: 2012-06-11 14:30:27.836--ServerSession(30146205)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/
                  [EL Finer]: 2012-06-11 14:30:27.839--ServerSession(30146205)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/
                  [EL Config]: 2012-06-11 14:30:27.941--ServerSession(30146205)--Thread(Thread[main,5,main])--The access type for the persistent class [class com.Region] is set to [FIELD].
                  [EL Config]: 2012-06-11 14:30:27.967--ServerSession(30146205)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.Region] is being defaulted to: Region.
                  [EL Finest]: 2012-06-11 14:30:27.989--ServerSession(30146205)--Thread(Thread[main,5,main])--End predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 0
                  [EL Finer]: 2012-06-11 14:30:27.989--Thread(Thread[main,5,main])--JavaSECMPInitializer - transformer is null.
                  [EL Finest]: 2012-06-11 14:30:27.989--ServerSession(30146205)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 0
                  [EL Finest]: 2012-06-11 14:30:27.99--ServerSession(30146205)--Thread(Thread[main,5,main])--End predeploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 1
                  [EL Finest]: 2012-06-11 14:30:27.994--ServerSession(30146205)--Thread(Thread[main,5,main])--Begin deploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Predeployed; factoryCount 1
                  [EL Finer]: 2012-06-11 14:30:28.003--ServerSession(30146205)--Thread(Thread[main,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
                  [EL Finest]: 2012-06-11 14:30:28.008--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.target-server; value=WebLogic_10; translated value=org.eclipse.persistence.platform.server.wls.WebLogic_10_Platform
                  [EL Finest]: 2012-06-11 14:30:28.008--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
                  [EL Finest]: 2012-06-11 14:30:28.008--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
                  [EL Finest]: 2012-06-11 14:30:28.009--ServerSession(30146205)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.user; value=hr
                  [EL Finest]: 2012-06-11 14:30:28.009--ServerSession(30146205)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.password; value=xxxxxx
                  [EL Finest]: 2012-06-11 14:30:28.458--ServerSession(30146205)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.driver; value=oracle.jdbc.OracleDriver
                  [EL Finest]: 2012-06-11 14:30:28.459--ServerSession(30146205)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.url; value=jdbc:oracle:thin:@localhost:1521:xe
                  [EL Finest]: 2012-06-11 14:30:28.459--ServerSession(30146205)--Thread(Thread[main,5,main])--property=eclipselink.cache.type.default; value=Full; translated value=org.eclipse.persistence.internal.identitymaps.FullIdentityMap
                  [EL Info]: 2012-06-11 14:30:28.46--ServerSession(30146205)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.3.2.v20111125-r10461
                  [EL Warning]: 2012-06-11 14:30:28.461--Thread(Thread[main,5,main])--java.lang.ClassNotFoundException: weblogic.version
                       at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
                       at java.security.AccessController.doPrivileged(Native Method)
                       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                       at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
                       at java.lang.Class.forName0(Native Method)
                       at java.lang.Class.forName(Class.java:169)
                       at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:107)
                       at org.eclipse.persistence.platform.server.wls.WebLogicPlatform.initializeServerNameAndVersion(WebLogicPlatform.java:85)
                       at org.eclipse.persistence.platform.server.ServerPlatformBase.getServerNameAndVersion(ServerPlatformBase.java:181)
                       at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:661)
                       at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:581)
                       at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
                       at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:488)
                       at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
                       at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
                       at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
                       at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
                       at com.Manager.main(Manager.java:15)

                  [EL Finest]: 2012-06-11 14:30:28.591--Thread(Thread[main,5,main])--Database platform: org.eclipse.persistence.platform.database.oracle.Oracle11Platform, regular expression: (?i)oracle.*11
                  [EL Finest]: 2012-06-11 14:30:28.591--Thread(Thread[main,5,main])--Database platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform, regular expression: (?i)oracle.*10
                  [EL Fine]: 2012-06-11 14:30:28.591--Thread(Thread[main,5,main])--Detected database platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform
                  [EL Config]: 2012-06-11 14:30:28.61--ServerSession(30146205)--Connection(25252664)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
                       platform=>Oracle10Platform
                       user name=> "hr"
                       datasource URL=> "jdbc:oracle:thin:@localhost:1521:xe"
                  ))
                  [EL Config]: 2012-06-11 14:30:28.62--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:xe
                       User: HR
                       Database: Oracle Version: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
                       Driver: Oracle JDBC driver Version: 10.2.0.1.0XE
                  [EL Finest]: 2012-06-11 14:30:28.621--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connection acquired from connection pool [default].
                  [EL Finest]: 2012-06-11 14:30:28.621--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connection released to connection pool [default].
                  [EL Info]: 2012-06-11 14:30:28.678--ServerSession(30146205)--Thread(Thread[main,5,main])--file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp login successful
                  [EL Warning]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
                  [EL Warning]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
                  [EL Warning]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--Failed to find MBean Server: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
                  [EL Finest]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--The applicationName for the MBean attached to session [file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp] is [unknown]
                  [EL Finest]: 2012-06-11 14:30:28.681--ServerSession(30146205)--Thread(Thread[main,5,main])--The moduleName for the MBean attached to session [file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp] is [unknown]
                  [EL Finer]: 2012-06-11 14:30:28.697--ServerSession(30146205)--Thread(Thread[main,5,main])--Canonical Metamodel class [com.Region_] not found during initialization.
                  [EL Finest]: 2012-06-11 14:30:28.697--ServerSession(30146205)--Thread(Thread[main,5,main])--End deploying Persistence Unit SimpleCoherenceApp; session file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/_SimpleCoherenceApp; state Deployed; factoryCount 1
                  [EL Finer]: 2012-06-11 14:30:28.714--ServerSession(30146205)--Thread(Thread[main,5,main])--client acquired: 6146452
                  [EL Finer]: 2012-06-11 14:30:28.727--ClientSession(6146452)--Thread(Thread[main,5,main])--acquire unit of work: 13994297
                  [EL Finest]: 2012-06-11 14:30:28.727--UnitOfWork(13994297)--Thread(Thread[main,5,main])--persist() operation called on: com.Region@124111a.
                  [EL Finer]: 2012-06-11 14:30:28.729--UnitOfWork(13994297)--Thread(Thread[main,5,main])--begin unit of work commit
                  [EL Finest]: 2012-06-11 14:30:28.736--UnitOfWork(13994297)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(com.Region@124111a)
                  [EL Finest]: 2012-06-11 14:30:28.738--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connection acquired from connection pool [default].
                  [EL Finer]: 2012-06-11 14:30:28.738--ClientSession(6146452)--Connection(3975755)--Thread(Thread[main,5,main])--begin transaction
                  [EL Fine]: 2012-06-11 14:30:28.739--ClientSession(6146452)--Connection(3975755)--Thread(Thread[main,5,main])--INSERT INTO REGIONS (REGION_ID, REGION_NAME) VALUES (?, ?)
                       bind => [12, Africa]
                  2012-06-11 14:30:28.973/1.408 Oracle Coherence 3.6.0.4 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/C:/Oracle/Middleware10.3.4.0/coherence_3.6/lib/coherence.jar!/tangosol-coherence.xml"
                  2012-06-11 14:30:28.976/1.411 Oracle Coherence 3.6.0.4 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/C:/Oracle/Middleware10.3.4.0/coherence_3.6/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
                  2012-06-11 14:30:28.976/1.411 Oracle Coherence 3.6.0.4 <Info> (thread=main, member=n/a): Loaded operational overrides from "file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/tangosol-coherence-override.xml"
                  2012-06-11 14:30:28.978/1.413 Oracle Coherence 3.6.0.4 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

                  Oracle Coherence Version 3.6.0.4 Build 19111
                  Grid Edition: Development mode
                  Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

                  2012-06-11 14:30:29.131/1.566 Oracle Coherence GE 3.6.0.4 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/C:/Users/Praveen/workspace/SimpleCoherenceApp/build/classes/coherence-cache-config.xml"
                  2012-06-11 14:30:29.719/2.154 Oracle Coherence GE 3.6.0.4 <D4> (thread=main, member=n/a): TCMP bound to /172.16.30.150:8088 using SystemSocketProvider
                  2012-06-11 14:30:33.317/5.752 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): Created a new cluster "cluster:0xC4DB" with Member(Id=1, Timestamp=2012-06-11 14:30:29.778, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:4388, Role=ManagerManager, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) UID=0xAC101E9600000137DAC5DED2A2961F98
                  2012-06-11 14:30:33.320/5.755 Oracle Coherence GE 3.6.0.4 <Info> (thread=main, member=n/a): Started cluster Name=cluster:0xC4DB

                  Group{Address=224.3.6.0, Port=36000, TTL=4}

                  MasterMemberSet
                  (
                  ThisMember=Member(Id=1, Timestamp=2012-06-11 14:30:29.778, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:4388, Role=ManagerManager)
                  OldestMember=Member(Id=1, Timestamp=2012-06-11 14:30:29.778, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:4388, Role=ManagerManager)
                  ActualMemberSet=MemberSet(Size=1, BitSetCount=2
                  Member(Id=1, Timestamp=2012-06-11 14:30:29.778, Address=172.16.30.150:8088, MachineId=41622, Location=machine:Praveen-PC,process:4388, Role=ManagerManager)
                  )
                  RecycleMillis=1200000
                  RecycleSet=MemberSet(Size=0, BitSetCount=0
                  )
                  )

                  TcpRing{Connections=[]}
                  IpMonitor{AddressListSize=0}

                  2012-06-11 14:30:33.339/5.774 Oracle Coherence GE 3.6.0.4 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
                  2012-06-11 14:30:33.495/5.930 Oracle Coherence GE 3.6.0.4 <D5> (thread=DistributedCache:EclipseLinkJPA, member=1): Service EclipseLinkJPA joined the cluster with senior service member 1
                  [EL Finer]: 2012-06-11 14:30:33.559--ClientSession(6146452)--Connection(3975755)--Thread(Thread[main,5,main])--rollback transaction
                  [EL Finest]: 2012-06-11 14:30:33.56--ServerSession(30146205)--Connection(3975755)--Thread(Thread[main,5,main])--Connection released to connection pool [default].
                  [EL Warning]: 2012-06-11 14:30:33.56--UnitOfWork(13994297)--Thread(Thread[main,5,main])--Local Exception Stack:
                  Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
                  Exception Description: Identity map constructor failed because an invalid identity map was specified.
                  Internal Exception: java.lang.reflect.InvocationTargetException
                  Target Invocation Exception: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
                  Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
                       at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:838)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:392)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:346)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:950)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:175)
                       at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
                       at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:421)
                       at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:272)
                       at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1623)
                       at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1588)
                       at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:275)
                       at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
                       at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
                       at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
                       at com.Manager.main(Manager.java:21)
                  Caused by: java.lang.reflect.InvocationTargetException
                       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                       at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeConstructor(PrivilegedAccessHelper.java:382)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:387)
                       ... 13 more
                  Caused by: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
                       at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.generateWrapper(WrapperGenerator.java:104)
                       at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.createWrapperFor(WrapperGenerator.java:96)
                       at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.defineWrapperClass(CoherenceCacheHelper.java:573)
                       at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.initializeForDescriptor(CoherenceCacheHelper.java:304)
                       at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:241)
                       at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
                       ... 19 more

                  [EL Finer]: 2012-06-11 14:30:33.562--UnitOfWork(13994297)--Thread(Thread[main,5,main])--release unit of work
                  [EL Finer]: 2012-06-11 14:30:33.562--ClientSession(6146452)--Thread(Thread[main,5,main])--client released
                  Exception in thread "main" javax.persistence.RollbackException: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
                  Exception Description: Identity map constructor failed because an invalid identity map was specified.
                  Internal Exception: java.lang.reflect.InvocationTargetException
                  Target Invocation Exception: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
                  Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
                       at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
                       at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
                       at com.Manager.main(Manager.java:21)
                  Caused by: Exception [EclipseLink-38] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
                  Exception Description: Identity map constructor failed because an invalid identity map was specified.
                  Internal Exception: java.lang.reflect.InvocationTargetException
                  Target Invocation Exception: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
                  Descriptor: RelationalDescriptor(com.Region --> [DatabaseTable(REGIONS)])
                       at org.eclipse.persistence.exceptions.DescriptorException.invalidIdentityMap(DescriptorException.java:838)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:392)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:346)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getIdentityMap(IdentityMapManager.java:950)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.acquireLockNoWait(IdentityMapManager.java:175)
                       at org.eclipse.persistence.internal.sessions.IdentityMapAccessor.acquireLockNoWait(IdentityMapAccessor.java:101)
                       at org.eclipse.persistence.internal.helper.WriteLockManager.attemptToAcquireLock(WriteLockManager.java:421)
                       at org.eclipse.persistence.internal.helper.WriteLockManager.acquireRequiredLocks(WriteLockManager.java:272)
                       at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.acquireWriteLocks(UnitOfWorkImpl.java:1623)
                       at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1588)
                       at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:275)
                       at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
                       at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
                       ... 2 more
                  Caused by: java.lang.reflect.InvocationTargetException
                       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                       at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeConstructor(PrivilegedAccessHelper.java:382)
                       at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.buildNewIdentityMap(IdentityMapManager.java:387)
                       ... 13 more
                  Caused by: java.lang.NoSuchMethodError: org.eclipse.persistence.internal.libraries.asm.ClassWriter.<init>(Z)V
                       at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.generateWrapper(WrapperGenerator.java:104)
                       at oracle.eclipselink.coherence.integrated.internal.cache.WrapperGenerator.createWrapperFor(WrapperGenerator.java:96)
                       at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.defineWrapperClass(CoherenceCacheHelper.java:573)
                       at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.initializeForDescriptor(CoherenceCacheHelper.java:304)
                       at oracle.eclipselink.coherence.integrated.internal.cache.CoherenceCacheHelper.getNamedCache(CoherenceCacheHelper.java:241)
                       at oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor.<init>(CoherenceInterceptor.java:79)
                       ... 19 more
                  2012-06-11 14:30:33.563/5.998 Oracle Coherence GE 3.6.0.4 <D4> (thread=ShutdownHook, member=1): ShutdownHook: stopping cluster node

                  Regards,
                  Praveen
                  • 6. Re: JPA on the Grid
                    User738616-Oracle
                    Hi Praveen,

                    Yes you would require the serializer for relationship serialization across entities. I would recommend you to go through the examples that can be downloaded here: http://www.oracle.com/technetwork/middleware/toplink/examples-325517-en-ca.html

                    894112 wrote:
                    Hi NJ,

                    I am getting error in the serializer element in coherence-cache-config.xml.It is saying that *"The content of Element type "serializer" must match (instance) "*.Even i tried by putting @CacheInterceptor(value = CoherenceInterceptor.class) in the entity class.Still facing the error in the serializer element.Is it mandatory to have serializer element in the caherence-cache-config.xml?


                    Regards,
                    Praveen
                    Hope this helps!

                    Cheers,
                    NJ