Lucene Directory & JDBC loader & Marshalling Exception
garcimouche May 26, 2010 12:50 PMHi,
I'm using the Infinispan implementation of the Lucene Directory with a jdbc binary store. My xml config is:
<namedCache name="luceneIndex"> <loaders passivation="false" shared="true" preload="false"> <loader fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false"> <properties> <property name="bucketTableNamePrefix" value="ISPN_BUCKET_TABLE" /> <property name="idColumnName" value="ID_COLUMN" /> <property name="dataColumnName" value="DATA_COLUMN" /> <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:mysql:///infinispan" /> <property name="userName" value="infinispan" /> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="idColumnType" value="VARCHAR(255)" /> <property name="dataColumnType" value="BINARY" /> <property name="dropTableOnExit" value="true" /> <property name="createTableOnStart" value="true" /> </properties> </loader> </loaders> <eviction strategy="NONE"/> <clustering mode="distribution"> <l1 enabled="true" lifespan="60000" /> <hash numOwners="2" /> <sync /> </clustering> <invocationBatching enabled="true" /> <transaction syncCommitPhase="true" syncRollbackPhase="true" transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup" useEagerLocking="true" /> </namedCache>
I try to create a new index using the lucene IndexWriter class and got this exception:
2010-05-26 12:44:12,318 ERROR (org.infinispan.marshall.VersionAwareMarshaller)[main:] Unable to read version id from first two bytes of stream, barfing. 2010-05-26 12:44:12,320 ERROR (org.infinispan.loaders.jdbc.JdbcUtil)[main:] I/O error while unmarshalling from stream java.io.IOException: Unable to read version id from first two bytes of stream: Read past end of file at org.infinispan.marshall.VersionAwareMarshaller.startObjectInput(VersionAwareMarshaller.java:155) at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:107) at org.infinispan.marshall.AbstractMarshaller.objectFromInputStream(AbstractMarshaller.java:24) at org.infinispan.loaders.jdbc.JdbcUtil.unmarshall(JdbcUtil.java:88) at org.infinispan.loaders.jdbc.binary.JdbcBinaryCacheStore.loadBucket(JdbcBinaryCacheStore.java:220) at org.infinispan.loaders.bucket.BucketBasedCacheStore.storeLockSafe(BucketBasedCacheStore.java:59) at org.infinispan.loaders.LockSupportCacheStore.store(LockSupportCacheStore.java:147) at org.infinispan.interceptors.DistCacheStoreInterceptor.visitPutKeyValueCommand(DistCacheStoreInterceptor.java:81) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118) at org.infinispan.interceptors.CacheLoaderInterceptor.visitPutKeyValueCommand(CacheLoaderInterceptor.java:78) .......more stack entries
I run version 4.1.0.ALPHA2 of infinispan. Anyone can give me a pointer ? ( I tried using JdbcStringBasedCacheStore but I guess the infinispan-lucene keys are not String compliant...).
Thank you.