Infinispan with TreeCacheAPI

被刻印的时光 ゝ 提交于 2019-12-11 05:59:24

问题


I am using Infinispan with TreeCache API on weblogic server 10.3.6. Since I am using TreeCache API, I have to use invocation batching.

Below is the XML

<?xml version="1.0" encoding="UTF-8"?>
<infinispan
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:infinispan:config:5.3 http://www.infinispan.org/schemas/infinispan-config-5.3.xsd"
      xmlns="urn:infinispan:config:5.3">

   <global>
        <globalJmxStatistics    enabled = "true" />
   </global>
   <default>

    <invocationBatching         enabled         = "true"/>  
    <jmxStatistics enabled="true"/>
   </default>
</infinispan>

I initialize the cache, by following:

private static Cache<Object, Object> infinispanCache;
private static TreeCache<Object, Object> Cache;

infinispanCache = new DefaultCacheManager(CacheConfigFilePath).getCache();                      
if(infinispanCache == null)
{
    System.out.println("InitializeForCaching(): Failed to intialize Infinispan cache");
                return;
}

Cache = new TreeCacheFactory().createTreeCache(infinispanCache);

Upon running,it gives me below exception, I am posting entire stacktrace

   ####<Nov 27, 2013 5:34:49 AM EST> <Warning> <JTA> <KhambhaP-E6530> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1385548489751> <BEA-110401> <Ignoring error in afterCompletion. Object=SynchronizationAdapter{localTransaction=LocalTransaction{remoteLockedNodes=null, isMarkedForRollback=false, lockedKeys=null, backupKeyLocks=null, topologyId=-1, isFromStateTransfer=false} org.infinispan.transaction.synchronization.SyncLocalTransaction@3} org.infinispan.transaction.synchronization.SynchronizationAdapter@22, Exception=org.infinispan.CacheException: Could not commit.
org.infinispan.CacheException: Could not commit.
    at org.infinispan.transaction.synchronization.SynchronizationAdapter.afterCompletion(SynchronizationAdapter.java:90)
    at weblogic.transaction.internal.ServerSCInfo.doAfterCompletion(ServerSCInfo.java:1053)
    at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(ServerSCInfo.java:1028)
    at weblogic.transaction.internal.ServerTransactionImpl.callAfterCompletions(ServerTransactionImpl.java:3074)
    at weblogic.transaction.internal.ServerTransactionImpl.afterRolledBackStateHousekeeping(ServerTransactionImpl.java:2953)
    at weblogic.transaction.internal.ServerTransactionImpl.setRolledBack(ServerTransactionImpl.java:2929)
    at weblogic.transaction.internal.ServerTransactionImpl.globalRetryRollback(ServerTransactionImpl.java:3172)
    at weblogic.transaction.internal.ServerTransactionImpl.globalRollback(ServerTransactionImpl.java:2919)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:374)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:267)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:307)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:301)
    at org.infinispan.batch.BatchContainer.resolveTransaction(BatchContainer.java:123)
    at org.infinispan.batch.BatchContainer.endBatch(BatchContainer.java:105)
    at org.infinispan.batch.BatchContainer.endBatch(BatchContainer.java:86)
    at org.infinispan.CacheImpl.endBatch(CacheImpl.java:793)
    at com.common.CacheManager.<init>(CacheManager.java:157)
    at com.common.First.doGet(First.java:39)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused By: javax.transaction.xa.XAException
    at org.infinispan.transaction.TransactionCoordinator.rollback(TransactionCoordinator.java:206)
    at org.infinispan.transaction.synchronization.SynchronizationAdapter.afterCompletion(SynchronizationAdapter.java:88)
    at weblogic.transaction.internal.ServerSCInfo.doAfterCompletion(ServerSCInfo.java:1053)
    at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(ServerSCInfo.java:1028)
    at weblogic.transaction.internal.ServerTransactionImpl.callAfterCompletions(ServerTransactionImpl.java:3074)
    at weblogic.transaction.internal.ServerTransactionImpl.afterRolledBackStateHousekeeping(ServerTransactionImpl.java:2953)
    at weblogic.transaction.internal.ServerTransactionImpl.setRolledBack(ServerTransactionImpl.java:2929)
    at weblogic.transaction.internal.ServerTransactionImpl.globalRetryRollback(ServerTransactionImpl.java:3172)
    at weblogic.transaction.internal.ServerTransactionImpl.globalRollback(ServerTransactionImpl.java:2919)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:374)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:267)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:307)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:301)
    at org.infinispan.batch.BatchContainer.resolveTransaction(BatchContainer.java:123)
    at org.infinispan.batch.BatchContainer.endBatch(BatchContainer.java:105)
    at org.infinispan.batch.BatchContainer.endBatch(BatchContainer.java:86)
    at org.infinispan.CacheImpl.endBatch(CacheImpl.java:793)
    at com.common.CacheManager.<init>(CacheManager.java:157)
    at com.common.First.doGet(First.java:39)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

Later on, I had tried to put an entry to cache using batch invocations:

infinispanCache.startBatch();
this.regionNode = rootNode.addChild(regionFQN);
infinispanCache.endBatch(true);

It gives me below exception,

org.infinispan.CacheException: Unable to end batch

Note this happens only on weblogic standalone server. Based on documentation, I understand that Infinispan uses transactions internally.So , does above error means I have to use customized transactions?

Can any one point out what i am doing wrong here. Thanks in advance.

来源:https://stackoverflow.com/questions/20240284/infinispan-with-treecacheapi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!