Infinispan 4.2.1FINAL in Websphere 7 problem: 2PC XAresource
niuxuetao_fiserv May 3, 2011 10:55 AMHello,
I am encountering such a 2PC XAResource registration problem when running in Websphere 7.0.0.9. The error stack is below:
Caused by: org.infinispan.CacheException: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:212)
at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:167)
at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:162)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:64)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:95)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:62)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:88)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:64)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:273)
at org.infinispan.CacheDelegate.get(CacheDelegate.java:209)
at com.fiserv.detection.eventcache.chm.ChmCacheStorage.get(ChmCacheStorage.java:29)
at com.fiserv.detection.eventcache.statemachine.CacheAccessor.getGroupAutoCreate(CacheAccessor.java:155)
at com.fiserv.detection.eventcache.statemachine.CacheAccessor.matchAll(CacheAccessor.java:63)
at com.fiserv.detection.tda.TimeDistanceAnalysis.doDetection(TimeDistanceAnalysis.java:86)
at com.fiserv.detection.pipeline.AbstractDetectionTaskInvoker.invoke(AbstractDetectionTaskInvoker.java:105)
... 119 more
The cache loader is JdbcStringBasedCacheLoader and the database underneath is SQLServer2005. Here is my config xml using local clustering mode:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Configuration Reference:
http://docs.jboss.org/infinispan/4.2/apidocs/config.html
-->
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:infinispan:config:4.2">
<global>
<!--
set the cluster name to distinguish from other programs that use
Infinispan
-->
<transport clusterName="xxxx"
transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" >
<properties>
<property name="configurationFile" value="jgroups-tcp.xml" />
</properties>
</transport>
</global>
<default>
<!-- set max locking time to 1s -->
<locking lockAcquisitionTimeout="1000" isolationLevel="READ_COMMITTED" />
<!-- do not use Infinispan eviction -->
<eviction maxEntries="1000" wakeUpInterval="-1" />
<!-- enabling indexing -->
<indexing indexLocalOnly="false" enabled="true" />
<!-- set the clustering mode to "asyncronous distribution" -->
<clustering mode="l">
<!-- this is the place to set the number of replications per store -->
<hash numOwners="2" />
</clustering>
<transaction />
<!-- make sure to disable passivation -->
<loaders passivation="false" shared="false" preload="true">
<loader
class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore"
fetchPersistentState="false" ignoreModifications="false"
purgeOnStartup="false">
<properties>
<property name="dropTableOnExit" value="false" />
<property name="createTableOnStart" value="true" />
<property name="stringsTableNamePrefix" value="EVENT_CACHE" />
<property name="idColumnName" value="ID_COLUMN" />
<property name="idColumnType" value="NVARCHAR(MAX)" />
<property name="dataColumnName" value="DATA_COLUMN" />
<property name="dataColumnType" value="VARBINARY(MAX)" />
<property name="timestampColumnName" value="TIMESTAMP_COLUMN" />
<property name="timestampColumnType" value="BIGINT" />
<property name="connectionFactoryClass"
value="my.RtdeConnectionFactory" />
</properties>
</loader>
</loaders>
</default>
</infinispan>
The connection factory my.RtdeConnectionFactory is coded inhouse which looks up DataSource from thread context that is populated somwhere else in the invoking Session Bean.
Please help, thanks!
Xuetao