This discussion is archived
1 2 Previous Next 21 Replies Latest reply: Oct 16, 2012 1:07 PM by ShaunSmith Go to original post RSS
  • 15. Re: JPA with ToplinkGrid-GridRead coherence configuration throws exception
    ShaunSmith Explorer
    Currently Being Moderated
    Hi Shri,

    I went through the exercise of downloading a fresh install of 10.3.5 to see if I could reproduce your problem. I manually updated WLS for JPA 2.0 [1], defined shared libraries for ActiveCache, TopLink Grid, and Coherence [2] , and built a very simple JSP that interacted with a Coherence CacheServer containing entities I had cached via a simple TopLink Grid based Java application. All is working with no problem. However at one point I had a newer version of EclipseLink on my cache server classpath than what is shipped in WLS and I got the exact same exception you did! It makes sense. Once I ensured my cache server and TopLink Grid client application were using the org.eclipse.persistence, toplinkgrid, and coherence jars from the WLS 10.3.5 install I was fine.

    I'm convinced that your problem is related to mixing versions of jars. In a clean install of 10.3.5 you won't find eclipselink.jar so I think your install is polluted by another install that may have been done on top of WLS 10.3.5.

    --Shaun

    [1] http://docs.oracle.com/cd/E17904_01/web.1111/e13720/using_toplink.htm#CIHDGHFE
    [2] http://docs.oracle.com/cd/E21764_01/web.1111/e16517/coh_wls.htm#BABHAHJG

    Edited by: Shaun Smith on Sep 21, 2012 12:22 PM
  • 16. Re: JPA with ToplinkGrid-GridRead coherence configuration throws exception
    775002 Newbie
    Currently Being Moderated
    Hi Shaun,

    I am agreed on your analysis, I install the platform fusion on the top of WLS. When eclipselink have higher version, it has the problem.

    My analysis regarding the java.io.InvalidClassException: org.eclipse.persistence.mappings.AttributeAccessor; errors was because coherence server started two places, one from the ear scope and other from server scope and this happen because of one bug in WLS 10.3.5. When i removed it from shared library, that solved the errors

    When started coherence from server level, the errors I found classCastException(already posted) which is valid from ADF search component which basically calls the typeQuery.getResultList(), this is called for count query and get results both. So from the toplink-grid when called for count query, it returns the Integer value which says that can not be cast to List. I have already raised the bug for it.

    I found the workaround that we need to call the typeQuery.getSingleResult() when count query called then call the getResultList(). which solved the problem.
    Here is log which shows the entities is cached.

    EL Fine]: 2012-10-16 13:25:54.563--ClientSession(393897418)--Connection(1689304272)--Thread(Thread[[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO OM_ACT_DOMAIN (DOMAIN_ID, NAME, SUSPENDED_MODE, VERSION, LOOPBACK_MODE, PARENT_DOMAIN_ID) VALUES (?, ?, ?, ?, ?, ?)
    bind => [1C9258E9-FB3E-40DF-B6EB-7CE9C50EA626, Temp DomaintestShri121, false, 1, false, null]
    [EL Fine]: 2012-10-16 13:25:54.623--ClientSession(393897418)--Connection(1689304272)--Thread(Thread[[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO OM_ACT_NETWORK_TARGET (NETWORK_TARGET_ID, DESCRIPTION, NAME, SUSPENDED_MODE, VERSION, LOOPBACK_MODE, DOMAIN_ID, MGMT_SYSTEM_ID, TARGET_TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
    bind => [96F5EED5-C866-48F0-A318-172B4677CDD5, 111, testShri121, false, 1, false, 1C9258E9-FB3E-40DF-B6EB-7CE9C50EA626, null, 1]
    *2012-10-16 13:25:54.719/469.398 Oracle Coherence GE 3.6.0.4 <D5> (thread=DistributedCache:EclipseLinkJPAReadOnly, member=1): Service EclipseLinkJPAReadOnly joined the cluster with senior service member 1*
    [EL Fine]: 2012-10-16 13:25:54.782--ServerSession(2023268972)--Thread(Thread[[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--**Coherence(Domain)::ConditionalPut: 1C9258E9-FB3E-40DF-B6EB-7CE9C50EA626 value: Object=[Domain]+ ID=[1C9258E9-FB3E-40DF-B6EB-7CE9C50EA626]**



    But when i called again the query count is 0.

    Value of the count query:0
    [EL Warning]: 2012-10-16 14:57:52.621--UnitOfWork(1807732151)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--FilterFactory.createValueExtractor::Does not support:
    Query Key name
    Query Key domain
    Base oracle.communications.activation.persistence.object.NetworkTarget. Query across relationship not supported
    [EL Fine]: 2012-10-16 14:57:52.63--ServerSession(14218329)--Connection(563462089)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT COUNT(t0.NETWORK_TARGET_ID) FROM OM_ACT_NETWORK_TARGET t0, OM_ACT_DOMAIN t1 WHERE (((t1.NAME = ?) AND (t0.TARGET_TYPE = ?)) AND (t1.DOMAIN_ID = t0.DOMAIN_ID))
    bind => [DomaintestShri121, 1]
    Value of the count query:0
    [EL Warning]: 2012-10-16 14:57:52.668--UnitOfWork(1807732151)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--FilterFactory.createValueExtractor::Does not support:
    Query Key name
    Query Key domain
    Base oracle.communications.activation.persistence.object.NetworkTarget. Query across relationship not supported
    [EL Fine]: 2012-10-16 14:57:52.669--ServerSession(14218329)--Connection(1166126190)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT COUNT(t0.NETWORK_TARGET_ID) FROM OM_ACT_NETWORK_TARGET t0, OM_ACT_DOMAIN t1 WHERE (((t1.NAME = ?) AND (t0.TARGET_TYPE = ?)) AND (t1.DOMAIN_ID = t0.DOMAIN_ID))
    bind => [DomaintestShri121, 1]

    Any suggestion on it.

    Edited by: user10385259 on Oct 16, 2012 3:13 AM
  • 17. Re: JPA with ToplinkGrid-GridRead coherence configuration throws exception
    ShaunSmith Explorer
    Currently Being Moderated
    Did you see a commit on the database after the inserts? If you execute the query directly against the database using SQLPlus do you get the result you're looking for?

    I can see in log that your second query is being performed using a different connection. If your inserts are uncommitted that connection won't see the changes.

    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
  • 18. Re: JPA with ToplinkGrid-GridRead coherence configuration throws exception
    775002 Newbie
    Currently Being Moderated
    Hi Shaun,
    Yes, the commit is successful, I can see the result on sqlplus. Is this because of the join query or something else.
    why the domain only cache ? There is a one-to-many relationship from Domain to NetworkTarget

    *Coherence(Domain)::ConditionalPut: 1C9258E9-FB3E-40DF-B6EB-7CE9C50EA626 value: Object=[Domain]+ ID=[1C9258E9-FB3E-40DF-B6EB-7CE9C50EA626]*


    Thanks
    Shri
  • 19. Re: JPA with ToplinkGrid-GridRead coherence configuration throws exception
    ShaunSmith Explorer
    Currently Being Moderated
    Because you have a join in your query it will always be executed on the database. I don't see how if SQLplus gives you the right answer how you could get the wrong answer when the same query is issued via JPA.

    Let's remove TopLink Grid from the equation to simplify the analysis. Disable Coherence caching and see if you get the same incorrect result.

    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 20. Re: JPA with ToplinkGrid-GridRead coherence configuration throws exception
    775002 Newbie
    Currently Being Moderated
    Hi Shaun,

    I have disabled the toplink-grid by adding the hints as shown below to query(count and results query) and it works fine. Below is the logs after searching the Object.

    typedQuery.setHint(QueryHints.QUERY_REDIRECTOR, new IgnoreDefaultRedirector());


    [EL Fine]: 2012-10-16 23:49:03.848--ServerSession(1689430694)--Connection(1664095403)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT COUNT(NETWORK_TARGET_ID) FROM OM_ACT_NETWORK_TARGET WHERE (TARGET_TYPE = ?)
    bind => [1]
    Value of the count query:3
    [EL Fine]: 2012-10-16 23:49:03.925--ServerSession(1689430694)--Connection(1112163312)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT * FROM (SELECT /*+ FIRST_ROWS */ a.*, ROWNUM rnum FROM (SELECT NETWORK_TARGET_ID AS a1, TARGET_TYPE AS a2, DESCRIPTION AS a3, NAME AS a4, SUSPENDED_MODE AS a5, VERSION AS a6, LOOPBACK_MODE AS a7, DOMAIN_ID AS a8, MGMT_SYSTEM_ID AS a9 FROM OM_ACT_NETWORK_TARGET WHERE (TARGET_TYPE = ?)) a WHERE ROWNUM <= ?) WHERE rnum > ?
    bind => [1, 25, 0]
    2012-10-16 23:49:06.096/853.771 Oracle Coherence GE 3.6.0.4 <D5> (thread=DistributedCache:EclipseLinkJPAReadOnly, member=1): Service EclipseLinkJPAReadOnly joined the cluster with senior service member 1
    [EL Fine]: 2012-10-16 23:49:06.233--ServerSession(1689430694)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(Domain)::Get: D391E3D9-645F-47C0-9871-171936DCE175 result: null
    [EL Fine]: 2012-10-16 23:49:06.247--ServerSession(1689430694)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(Domain)::Get: 8A76EA89-DF59-423C-9B74-1C6E196985E0 result: null
    [EL Fine]: 2012-10-16 23:49:06.25--ServerSession(1689430694)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(Domain)::Get: 1C9258E9-FB3E-40DF-B6EB-7CE9C50EA626 result: null






    The below logs when created new entity and again search with the above code

    [EL Fine]: 2012-10-17 00:32:04.665--ClientSession(1943482851)--Connection(890005887)--Thread(Thread[[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO OM_ACT_DOMAIN (DOMAIN_ID, NAME, SUSPENDED_MODE, VERSION, LOOPBACK_MODE, PARENT_DOMAIN_ID) VALUES (?, ?, ?, ?, ?, ?)
    bind => [1F51BFE5-F6DB-426D-9E66-575D2D259D90, Temp DomaintestShri1453, false, 1, false, null]
    [EL Fine]: 2012-10-17 00:32:04.686--ClientSession(1943482851)--Connection(890005887)--Thread(Thread[[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO OM_ACT_NETWORK_TARGET (NETWORK_TARGET_ID, DESCRIPTION, NAME, SUSPENDED_MODE, VERSION, LOOPBACK_MODE, DOMAIN_ID, MGMT_SYSTEM_ID, TARGET_TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
    bind => [1C5EFA40-C090-4370-B68D-1956CA68A47F, null, testShri1453, false, 1, false, 1F51BFE5-F6DB-426D-9E66-575D2D259D90, null, 1]
    [EL Fine]: 2012-10-17 00:32:04.744--ServerSession(1776085280)--Thread(Thread[[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])-*-Coherence(Domain)::ConditionalPut: 1F51BFE5-F6DB-426D-9E66-575D2D259D90 value: Object=[Domain]+ ID=[1F51BFE5-F6DB-426D-9E66-575D2D259D90]*
    Sql Statement: SELECT COUNT(o) FROM NetworkTarget o
    Value of the count query:0
    [EL Fine]: 2012-10-17 00:32:05.109--ServerSession(154018541)--Connection(637038561)--Thread(Thread[[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT COUNT(NETWORK_TARGET_ID) FROM OM_ACT_NETWORK_TARGET WHERE (TARGET_TYPE = ?)
    bind => [1]
    Value of the count query without coherence:4
    Value of the results query without coherence:
    [EL Fine]: 2012-10-17 00:32:05.114--ServerSession(154018541)--Connection(2096325324)--Thread(Thread[[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT * FROM (SELECT /*+ FIRST_ROWS */ a.*, ROWNUM rnum FROM (SELECT NETWORK_TARGET_ID AS a1, TARGET_TYPE AS a2, DESCRIPTION AS a3, NAME AS a4, SUSPENDED_MODE AS a5, VERSION AS a6, LOOPBACK_MODE AS a7, DOMAIN_ID AS a8, MGMT_SYSTEM_ID AS a9 FROM OM_ACT_NETWORK_TARGET WHERE (TARGET_TYPE = ?)) a WHERE ROWNUM <= ?) WHERE rnum > ?
    bind => [1, 25, 0]
    [EL Fine]: 2012-10-17 00:32:05.121--ServerSession(154018541)--Thread(Thread[[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(Domain)::Get: 1F51BFE5-F6DB-426D-9E66-575D2D259D90 result: Object=[Domain]+ ID=[1F51BFE5-F6DB-426D-9E66-575D2D259D90]
    [EL Fine]: 2012-10-17 00:32:05.124--ServerSession(154018541)--Thread(Thread[[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(Domain)::Get: 1F51BFE5-F6DB-426D-9E66-575D2D259D90 result: Object=[Domain]+ ID=[1F51BFE5-F6DB-426D-9E66-575D2D259D90]
    <Oct 17, 2012 12:33:07 AM IST> <Warning> <JMSPool> <BEA-169808> <There was an error while making the initial connection to the JMS resource named oracle/communications/ordermanagement/constrained/execution/ConnectionFactory from the EJB "ResourceResponseManagerBean" inside application "oms". The server will attempt the connection again later. The error was javax.jms.JMSException: [JMSPool:169803]JNDI lookup of the JMS connection factory oracle/communications/ordermanagement/constrained/execution/ConnectionFactory failed: javax.naming.NameNotFoundException: While trying to lookup 'oracle.communications.ordermanagement.constrained.execution/ConnectionFactory' didn't find subcontext 'constrained'. Resolved 'oracle.communications.ordermanagement'; remaining name 'constrained/execution/ConnectionFactory'>
    Sql Statement: SELECT COUNT(o) FROM NetworkTarget o
    Value of the count query:0
    [EL Fine]: 2012-10-17 00:34:11.885--ServerSession(154018541)--Connection(411599845)--Thread(Thread[[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT COUNT(NETWORK_TARGET_ID) FROM OM_ACT_NETWORK_TARGET WHERE (TARGET_TYPE = ?)
    bind => [1]
    Value of the count query without coherence:4
    Value of the results query without coherence:
    [EL Fine]: 2012-10-17 00:34:11.89--ServerSession(154018541)--Connection(729987786)--Thread(Thread[[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT * FROM (SELECT /*+ FIRST_ROWS */ a.*, ROWNUM rnum FROM (SELECT NETWORK_TARGET_ID AS a1, TARGET_TYPE AS a2, DESCRIPTION AS a3, NAME AS a4, SUSPENDED_MODE AS a5, VERSION AS a6, LOOPBACK_MODE AS a7, DOMAIN_ID AS a8, MGMT_SYSTEM_ID AS a9 FROM OM_ACT_NETWORK_TARGET WHERE (TARGET_TYPE = ?)) a WHERE ROWNUM <= ?) WHERE rnum > ?
    bind => [1, 25, 0]
    [EL Fine]: 2012-10-17 00:34:11.894--ServerSession(154018541)--Thread(Thread[[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--*Coherence(Domain)::Get: 1F51BFE5-F6DB-426D-9E66-575D2D259D90 result: Object=[Domain]+ ID=[1F51BFE5-F6DB-426D-9E66-575D2D259D90]*






    Thanks
    Shri
  • 21. Re: JPA with ToplinkGrid-GridRead coherence configuration throws exception
    ShaunSmith Explorer
    Currently Being Moderated
    Hi Shri,

    I'm going to take this offline with you to get more detailed information about your configuration.

    --Shaun                                                                                                                                                                                                                                                       
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points