I have been trying to configure Jackrabbit with Oracle. I get an exception while the schema check is performed for the version table in cluster.
While the cluster configuration is being initialized it calls the init()
method in the DataBaseJournal
class. In there it calls checkLocalRevisionSchema()
; That method in turns call CheckSchemaOperation.run()
to check whether the LOCAL_REVISIONS table exists if not it creates it. At first time it does not have the table so it tries to create the table with:
create table ${schemaObjectPrefix}JOURNAL (
REVISION_ID number(20,0) NOT NULL,
JOURNAL_ID varchar(255),
PRODUCER_ID varchar(255),
REVISION_DATA blob
)
${tablespace}
Before executing the query the variable ${schemOBjectPrefix}
is replaced with PBVP_Journal
but the ${tablespace}
is not being replaced. I am not sure what I am doing wrong.
My file system and persistence manager configuration looks like:
<Versioning rootPath="${rep.home}/version">
<FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
<param name="driver" value="javax.naming.InitialContext"/>
<param name="url" value="java:/jcr/repositoryDB"/>
<param name="schemaObjectPrefix" value="PBVP_version_"/>
<param name="schema" value="oracle"/>
</FileSystem>
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager">
<param name="driver" value="javax.naming.InitialContext"/>
<param name="url" value="java:/jcr/repositoryDB"/>
<param name="databaseType" value="oracle"/>
<param name="schemaObjectPrefix" value="PBVP_version_"/>
<param name="bundleCacheSize" value="32"/>
<param name="tableSpace" value="default"/>
</PersistenceManager>
</Versioning>
My cluster configuration looks like
<Cluster id="node1" syncDelay="2000">
<Journal class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">
<param name="revision" value="${rep.home}/revision.log"/>
<param name="driver" value="javax.naming.InitialContext"/>
<param name="url" value="java:/jcr/repositoryDB"/>
<param name="schemaObjectPrefix" value="PBVP_journal_"/>
<param name="databaseType" value="oracle"/>
<param name="schemaCheckEnabled" value="false"/>
<param name="tablespace" value="default"/>
</Journal>
</Cluster>
Finally now I know what is going on.The Jackrabbit configuration loading mechanism goes through two routes
When I debugged I was following the second route so I concentrated on why does not it try to resolve the ${tablespace} in the sql statement. It should not take the second route if the first deployment is success. In our case the first deployment failed because of the length of table name. If we change the length of the table name it deploys ok so it should never come to second scenario