1 Reply Latest reply: Jun 7, 2012 2:28 PM by gstachni-Oracle RSS

    Cohence with TopLink GRID

    878913
      Hi All ,

      I am working with JPA with coherence , my task is to put the data into the database through coherence toplink grid when ever my database get shutdown i have to get data from coherence ... i followed this link " http://docs.oracle.com/cd/E17904_01/doc.1111/e16596/configjpa.htm "

      everything is working fine when ever database got shutdown its showing following error...

      1.created the jpa application
      2.Integrating with database
      3.created jpa entities from tables
      4.created the class to put the data (its working fine ), when the db shutdown data is not getting from the coherence.
      is it right method ? pls give reply...how do i approach to this task...

      [ i am using this property to connect to the coherence
      import oracle.eclipselink.coherence.integrated.config.GridCacheCustomizer;
      import org.eclipse.persistence.annotations.Customizer;

      @Entity
      @Customizer(GridCacheCustomizer.class) ]


      [EL Finest]: 2012-06-07 21:06:05.058--ServerSession(10933534)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit JPA3.6; session file:/C:/Users/lakshmana/JPACoherenceWorkspace/JPA3.6/build/classes/_JPA3.6; state Initial; factoryCount 0
      [EL Finest]: 2012-06-07 21:06:05.074--ServerSession(10933534)--Thread(Thread[main,5,main])--property=eclipselink.orm.throw.exceptions; default value=true
      [EL Finest]: 2012-06-07 21:06:05.093--ServerSession(10933534)--Thread(Thread[main,5,main])--property=eclipselink.jpa.uppercase-column-names; default value=false
      [EL Finer]: 2012-06-07 21:06:05.093--ServerSession(10933534)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/Users/lakshmana/JPACoherenceWorkspace/JPA3.6/build/classes/
      [EL Finer]: 2012-06-07 21:06:05.096--ServerSession(10933534)--Thread(Thread[main,5,main])--Searching for default mapping file in file:/C:/Users/lakshmana/JPACoherenceWorkspace/JPA3.6/build/classes/
      [EL Config]: 2012-06-07 21:06:05.185--ServerSession(10933534)--Thread(Thread[main,5,main])--The access type for the persistent class [class com.jpa.Employee] is set to [FIELD].
      [EL Config]: 2012-06-07 21:06:05.209--ServerSession(10933534)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.jpa.Employee] is being defaulted to: Employee.
      [EL Config]: 2012-06-07 21:06:05.211--ServerSession(10933534)--Thread(Thread[main,5,main])--The table name for entity [class com.jpa.Employee] is being defaulted to: EMPLOYEE.
      [EL Finest]: 2012-06-07 21:06:05.227--ServerSession(10933534)--Thread(Thread[main,5,main])--End predeploying Persistence Unit JPA3.6; session file:/C:/Users/lakshmana/JPACoherenceWorkspace/JPA3.6/build/classes/_JPA3.6; state Predeployed; factoryCount 0
      [EL Finer]: 2012-06-07 21:06:05.227--Thread(Thread[main,5,main])--JavaSECMPInitializer - transformer is null.
      [EL Finest]: 2012-06-07 21:06:05.227--ServerSession(10933534)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit JPA3.6; session file:/C:/Users/lakshmana/JPACoherenceWorkspace/JPA3.6/build/classes/_JPA3.6; state Predeployed; factoryCount 0
      [EL Finest]: 2012-06-07 21:06:05.227--ServerSession(10933534)--Thread(Thread[main,5,main])--End predeploying Persistence Unit JPA3.6; session file:/C:/Users/lakshmana/JPACoherenceWorkspace/JPA3.6/build/classes/_JPA3.6; state Predeployed; factoryCount 1
      [EL Finest]: 2012-06-07 21:06:05.23--ServerSession(10933534)--Thread(Thread[main,5,main])--Begin deploying Persistence Unit JPA3.6; session file:/C:/Users/lakshmana/JPACoherenceWorkspace/JPA3.6/build/classes/_JPA3.6; state Predeployed; factoryCount 1
      [EL Finer]: 2012-06-07 21:06:05.239--ServerSession(10933534)--Thread(Thread[main,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
      [EL Finest]: 2012-06-07 21:06:05.246--ServerSession(10933534)--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-07 21:06:05.246--ServerSession(10933534)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
      [EL Finest]: 2012-06-07 21:06:05.246--ServerSession(10933534)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
      [EL Finest]: 2012-06-07 21:06:05.247--ServerSession(10933534)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.user; value=system
      [EL Finest]: 2012-06-07 21:06:05.247--ServerSession(10933534)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.password; value=xxxxxx
      [EL Finest]: 2012-06-07 21:06:05.674--ServerSession(10933534)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.driver; value=oracle.jdbc.OracleDriver
      [EL Finest]: 2012-06-07 21:06:05.674--ServerSession(10933534)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.url; value=jdbc:oracle:thin:@localhost:1521:xe
      [EL Finest]: 2012-06-07 21:06:05.675--ServerSession(10933534)--Thread(Thread[main,5,main])--property=eclipselink.cache.type.default; value=Full; translated value=org.eclipse.persistence.internal.identitymaps.FullIdentityMap
      [EL Finest]: 2012-06-07 21:06:05.675--ServerSession(10933534)--Thread(Thread[main,5,main])--property=eclipselink.cache.shared.default; value=true; translated value=true
      [EL Info]: 2012-06-07 21:06:05.676--ServerSession(10933534)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.1.2.v20101206-r8635
      [EL Warning]: 2012-06-07 21:06:05.676--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:81)
           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:653)
           at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:576)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
           at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:389)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:164)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:221)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:209)
           at com.jpa.Main.main(Main.java:13)

      [EL Finer]: 2012-06-07 21:06:05.744--ServerSession(10933534)--Thread(Thread[main,5,main])--DriverManager connect failed, trying direct connect.
      [EL Finer]: 2012-06-07 21:06:05.744--ServerSession(10933534)--Thread(Thread[main,5,main])--java.sql.SQLException: Listener refused the connection with the following error:
      ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
      The Connection descriptor used by the client was:
      localhost:1521:xe

           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
           at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
           at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
           at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
           at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
           at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
           at java.sql.DriverManager.getConnection(DriverManager.java:582)
           at java.sql.DriverManager.getConnection(DriverManager.java:154)
           at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
           at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
           at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:579)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
           at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:389)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:164)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:221)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:209)
           at com.jpa.Main.main(Main.java:13)

      [EL Severe]: 2012-06-07 21:06:05.755--ServerSession(10933534)--Thread(Thread[main,5,main])--Local Exception Stack:
      Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
      Internal Exception: java.sql.SQLException: Listener refused the connection with the following error:
      ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
      The Connection descriptor used by the client was:
      localhost:1521:xe

      Error Code: 0
           at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
           at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
           at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
           at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
           at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:579)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
           at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:389)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:164)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:221)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:209)
           at com.jpa.Main.main(Main.java:13)
      Caused by: java.sql.SQLException: Listener refused the connection with the following error:
      ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
      The Connection descriptor used by the client was:
      localhost:1521:xe

           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
           at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
           at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
           at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
           at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
           at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
           at java.sql.DriverManager.getConnection(DriverManager.java:582)
           at java.sql.DriverManager.getConnection(DriverManager.java:154)
           at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
           ... 8 more

      [EL Finest]: 2012-06-07 21:06:05.755--ServerSession(10933534)--Thread(Thread[main,5,main])--End deploying Persistence Unit JPA3.6; session file:/C:/Users/lakshmana/JPACoherenceWorkspace/JPA3.6/build/classes/_JPA3.6; state Deployed; factoryCount 1
      Exception in thread "main" javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
      Internal Exception: java.sql.SQLException: Listener refused the connection with the following error:
      ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
      The Connection descriptor used by the client was:
      localhost:1521:xe

      Error Code: 0
           at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:417)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:164)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:221)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:209)
           at com.jpa.Main.main(Main.java:13)
      Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
      Internal Exception: java.sql.SQLException: Listener refused the connection with the following error:
      ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
      The Connection descriptor used by the client was:
      localhost:1521:xe

      Error Code: 0
           at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
           at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
           at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
           at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
           at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:579)
           at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
           at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:389)
           ... 4 more
      Caused by: java.sql.SQLException: Listener refused the connection with the following error:
      ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
      The Connection descriptor used by the client was:
      localhost:1521:xe

           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
           at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
           at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
           at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
           at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
           at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
           at java.sql.DriverManager.getConnection(DriverManager.java:582)
           at java.sql.DriverManager.getConnection(DriverManager.java:154)
           at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
           ... 8 more