Unsupported key type: 'org.infinispan.util.ByteArrayKey'
jayaprasadrao Nov 11, 2011 3:39 AMHi All,
I tried to implement JdbcStringBasedCacheStore using oracle database. Infinispan with hotrod start correctly with the following configuration. When I tried to insert some values into cache I got the following exception. Please advise on this.
Thanks in advance.
---- Configuration ---
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
xmlns="urn:infinispan:config:5.0">
<namedCache name="__customerProfile__">
<loaders
passivation="false" shared="false" preload="true">
<loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore"
fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="stringsTableNamePrefix" value="ISPN_"/>
<property name="idColumnName" value="ID_COLUMN"/>
<property name="dataColumnName" value="DATA_COLUMN"/>
<property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>
<property name="timestampColumnType" value="NUMERIC"/>
<property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>
<property name="connectionUrl" value="jdbc:oracle:thin:@192.168.1.22:1521:XE"/>
<property name="userName" value="hotrod"/>
<property name="password" value="hotrod"/>
<property name="driverClass" value="oracle.jdbc.OracleDriver"/>
<property name="idColumnType" value="VARCHAR2(500)"/>
<property name="dataColumnType" value="BLOB"/>
<property name="dropTableOnExit" value="true"/>
<property name="createTableOnStart" value="true"/>
</properties>
</loader>
</loaders>
</namedCache>
</infinispan>
---- Configuration ends --
-- Exception --
Nov 11, 2011 4:37:33 PM org.infinispan.client.hotrod.impl.operations.HotRodOperation checkForErrorsInResponseStatus
WARN: ISPN004005: Error received from the server: org.infinispan.CacheException: org.infinispan.loaders.keymappers.UnsupportedKeyTypeException: Unsupported key type: 'org.infinispan.util.ByteArrayKey' on key: ByteArrayKey{data=ByteArray{size=4, hashCode=757753a8, array=[3, 62, 1, 49, ..]}}
org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for message id[3] returned server error (status=0x85): org.infinispan.CacheException: org.infinispan.loaders.keymappers.UnsupportedKeyTypeException: Unsupported key type: 'org.infinispan.util.ByteArrayKey' on key: ByteArrayKey{data=ByteArray{size=4, hashCode=757753a8, array=[3, 62, 1, 49, ..]}}
at org.infinispan.client.hotrod.impl.operations.HotRodOperation.checkForErrorsInResponseStatus(HotRodOperation.java:172)
at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:132)
at org.infinispan.client.hotrod.impl.operations.AbstractKeyValueOperation.sendPutOperation(AbstractKeyValueOperation.java:70)
at org.infinispan.client.hotrod.impl.operations.PutOperation.executeOperation(PutOperation.java:49)
at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:62)
at org.infinispan.client.hotrod.impl.RemoteCacheImpl.put(RemoteCacheImpl.java:203)
at org.infinispan.CacheSupport.put(CacheSupport.java:51)
at com.rbtsb.infinispan.HotrodClientDemo.runDemo(HotrodClientDemo.java:25)
at com.rbtsb.infinispan.HotrodClientDemo.main(HotrodClientDemo.java:55)