0 Replies Latest reply on Mar 13, 2013 3:50 AM by ivan smith

    Are JdbcStringBasedCacheStore's compatible with Hotrod named caches ?

    ivan smith Newbie

      I'm using Infinispan 5.2.1 with a Java 1.6 client to store data into a remote Hotrod cache<Long, String> defined below :-

       

      <namedCache name="cache">

                          <clustering mode="distribution">

                                    <sync />

                                    <hash numOwners="2" />

                                    <l1 enabled="true" lifespan="600000" />

                          </clustering>

                          <loaders

                         passivation="false" shared="false" preload="false">

                         <loader

                            class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore"

                            fetchPersistentState="false" purgeOnStartup="false">

                            <properties>

                                <property name="stringsTableNamePrefix" value="ISPN_STRING_TABLE" />

                                                        <property name="idColumnName" value="ID_COLUMN" />

                                                        <property name="idColumnType" value="VARCHAR(255)" />

                                                        <property name="dataColumnName" value="DATA_COLUMN" />

                                                        <property name="dataColumnType" value="BYTEA" />

                                                        <property name="timestampColumnName" value="TIMESTAMP_COLUMN" />

                                                        <property name="timestampColumnType" value="BIGINT" />

                                                        <property name="connectionFactoryClass"

                                                                  value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory" />

                                                        <property name="connectionUrl" value="jdbc:postgresql://XXXXXXXXXXXX" />

                                                        <property name="userName" value="ats_owner" />

                                                        <property name="password" value="ats_owner" />

                                                        <property name="driverClass" value="org.postgresql.Driver"/>

                                                        <property name="dropTableOnExit" value="false" />

                                                        <property name="createTableOnStart" value="true" />

                            </properties>

                         </loader>

                      </loaders>

                </namedCache>

       

      The data seems to write to the db OK, but when I restart Hotrod and try to get the data I am getting this error :-

       

      2013-03-12 17:31:40,325 ERROR (HotRodServerWorker-2) [org.infinispan.interceptors.InvocationContextInterceptor] ISPN000136: Execution error

      java.lang.ClassCastException: java.lang.Class cannot be cast to org.infinispan.container.entries.InternalCacheValue

                at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.readStoredEntry(JdbcStringBasedCacheStore.java:412)

                at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.loadLockSafe(JdbcStringBasedCacheStore.java:343)

                at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.loadLockSafe(JdbcStringBasedCacheStore.java:87)

                at org.infinispan.loaders.LockSupportCacheStore.load(LockSupportCacheStore.java:142)

                at org.infinispan.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:170)

                at org.infinispan.interceptors.CacheLoaderInterceptor.loadIfNeededAndUpdateStats(CacheLoaderInterceptor.java:231)

                at org.infinispan.interceptors.CacheLoaderInterceptor.visitGetKeyValueCommand(CacheLoaderInterceptor.java:112)

                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                at org.infinispan.interceptors.EntryWrappingInterceptor.visitGetKeyValueCommand(EntryWrappingInterceptor.java:126)

                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitGetKeyValueCommand(NonTransactionalLockingInterceptor.java:71)

                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)

                at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:104)

                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)

                at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:104)

                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                at org.infinispan.statetransfer.StateTransferInterceptor.handleTopologyAffectedCommand(StateTransferInterceptor.java:216)

                at org.infinispan.statetransfer.StateTransferInterceptor.handleDefault(StateTransferInterceptor.java:200)

                at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:104)

                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:92)

                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)

                at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)

                at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:104)

                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)

                at org.infinispan.CacheImpl.get(CacheImpl.java:283)

                at org.infinispan.CacheImpl.get(CacheImpl.java:275)

                at org.infinispan.server.core.AbstractProtocolDecoder.get(AbstractProtocolDecoder.scala:281)

                at org.infinispan.server.core.AbstractProtocolDecoder.decodeKey(AbstractProtocolDecoder.scala:115)

                at org.infinispan.server.core.AbstractProtocolDecoder.decode(AbstractProtocolDecoder.scala:71)

                at org.infinispan.server.core.AbstractProtocolDecoder.decode(AbstractProtocolDecoder.scala:47)

                at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:500)

                at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435)

                at org.infinispan.server.core.AbstractProtocolDecoder.messageReceived(AbstractProtocolDecoder.scala:387)

                at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)

                at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)

                at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555)

                at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)

                at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)

                at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)

                at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)

                at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:313)

                at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)

                at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)

                at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

                at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

       

      My Questions are :-

      1) Is Hotrod compatible with this loader

      1.1) If compatible what config do I need to 'tweak'.

      1.2) If not compatible what are the alternatives for Hotrod being able to recover data from a restart - exclude FileCacheStore which is not recommended

      1.3) If it's a bug could you provide the jira number so that I can track it.

       

      Thanks In Advance..