jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karan Malhi <karan.ma...@gmail.com>
Subject Migrating from derby to h2 using jackrabbit standalone jar causing exception in h2
Date Sun, 20 Apr 2014 17:30:20 GMT
I am trying to migrate an existing repository from
org.apache.jackrabbit.core.persistence.db.DerbyPersistenceManager to
org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager and it
worked like a charm.

Now I am trying to migrate the same repository to
org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager and am
getting a unique/primary key violation in h2 (see below). Appreciate any
help getting around this issue.

$ java -Xmx1024m -jar jackrabbit-standalone-2.8-SNAPSHOT.jar --backup
--repo target-data --conf new-repository.xml --backup-repo ./target-data-h2
--backup-conf new-repository-h2.xml
Welcome to Apache Jackrabbit!
-------------------------------
Using repository directory target-data
Writing log messages to target-data/log
Creating a repository copy in ./target-data-h2
Exception in thread "main" javax.jcr.RepositoryException: failed to
instantiate shared item state manager
    at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:2084)
    at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:2035)
    at
org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:543)
    at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:326)
    at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:615)
    at
org.apache.jackrabbit.core.RepositoryCopier.copy(RepositoryCopier.java:149)
    at
org.apache.jackrabbit.core.RepositoryCopier.copy(RepositoryCopier.java:112)
    at org.apache.jackrabbit.standalone.Main.backup(Main.java:218)
    at org.apache.jackrabbit.standalone.Main.run(Main.java:161)
    at org.apache.jackrabbit.standalone.Main.main(Main.java:60)
Caused by: org.apache.jackrabbit.core.state.ItemStateException: FATAL error
while writing the bundle: deadbeef-cafe-babe-cafe-babecafebabe
    at
org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.storeBundle(BundleDbPersistenceManager.java:964)
    at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.putBundle(AbstractBundlePersistenceManager.java:802)
    at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.storeInternal(AbstractBundlePersistenceManager.java:717)
    at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.store(AbstractBundlePersistenceManager.java:593)
    at
org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.store(BundleDbPersistenceManager.java:482)
    at
org.apache.jackrabbit.core.state.SharedItemStateManager.createRootNodeState(SharedItemStateManager.java:1718)
    at
org.apache.jackrabbit.core.state.SharedItemStateManager.<init>(SharedItemStateManager.java:217)
    at
org.apache.jackrabbit.core.RepositoryImpl.createItemStateManager(RepositoryImpl.java:1396)
    at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:2062)
    ... 9 more
Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key
violation: "PRIMARY_KEY_D ON PUBLIC.JACKRABBIT_X0020_CORE_BUNDLE(NODE_ID)
VALUES (X'deadbeefcafebabecafebabecafebabe', 3)"; SQL statement:
insert into JACKRABBIT_x0020_CORE_BUNDLE (BUNDLE_DATA, NODE_ID) values (?,
?) [23505-177]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
    at org.h2.message.DbException.get(DbException.java:178)
    at org.h2.message.DbException.get(DbException.java:154)
    at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103)
    at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:207)
    at org.h2.mvstore.db.MVTable.addRow(MVTable.java:611)
    at org.h2.command.dml.Insert.insertRows(Insert.java:157)
    at org.h2.command.dml.Insert.update(Insert.java:115)
    at org.h2.command.CommandContainer.update(CommandContainer.java:79)
    at org.h2.command.Command.executeUpdate(Command.java:254)
    at
org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:199)
    at
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at
org.apache.jackrabbit.core.util.db.ConnectionHelper.execute(ConnectionHelper.java:518)
    at
org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyUpdate(ConnectionHelper.java:346)
    at
org.apache.jackrabbit.core.util.db.ConnectionHelper$2.call(ConnectionHelper.java:333)
    at
org.apache.jackrabbit.core.util.db.ConnectionHelper$2.call(ConnectionHelper.java:329)
    at
org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:552)
    at
org.apache.jackrabbit.core.util.db.ConnectionHelper.update(ConnectionHelper.java:329)
    at
org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.storeBundle(BundleDbPersistenceManager.java:950)
    ... 17 more

-- 

Karan Singh Malhi
twitter.com/KaranSinghMalhi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message