SQL Exception with JDBC cahce loader with apache derby
dex80526 Jun 4, 2012 4:09 PMI configured my cache store using JdbcStringBasedCacheStore.
Is my configure wrong?
How to fix it?
The following are the cofig and exception:
<loader
class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore"
fetchPersistentState="true"
purgeOnStartup="false">
<properties>
<property name="stringsTableNamePrefix" value="ISPN_STRING_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.ManagedConnectionFactory"/>
<property name="datasourceJndiLocation" value="java:comp/env/jdbc/UserProfileDB"/>
<property name="idColumnType" value="VARCHAR(255)"/>
<property name="dataColumnType" value="BINARY"/>
<property name="dropTableOnExit" value="false"/>
<property name="createTableOnStart" value="true"/>
</properties>
</loader>
ERROR org.infinispan.loaders.jdbc.TableManipulation[156] - ISPN008011: Error while creating table; used DDL statement: 'CREATE TABLE ISPN_STRING_TABLE_keychain(ID_COLUMN VARCHAR(255) NOT NULL, DATA_COLUMN BINARY, TIMESTAMP_COLUMN BIGINT, PRIMARY KEY (ID_COLUMN))'
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "," at line 1, column 92.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source)
at org.infinispan.loaders.jdbc.TableManipulation.executeUpdateSql(TableManipulation.java:154)
at org.infinispan.loaders.jdbc.TableManipulation.createTable(TableManipulation.java:130)
at org.infinispan.loaders.jdbc.TableManipulation.start(TableManipulation.java:231)
at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.doConnectionFactoryInitialization(JdbcStringBasedCacheStore.java:366)
at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.start(JdbcStringBasedCacheStore.java:121)
at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:236)
at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:885)
at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:639)
at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:628)
at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:531)
at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:174)
at org.infinispan.CacheImpl.start(CacheImpl.java:521)
at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:656)
at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:549)
.....