jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Mucha" <sing...@gmx.net>
Subject unable to start repository because of missing DEFAULT_NAMES table in derby backend
Date Thu, 06 Aug 2009 20:02:13 GMT
Hello ,

i try to start a jackrabbit repository. I use the 1.5.7 standalone jar.
My code looks like this :

Repository repository = new TransientRepository();
Session session = repository.login();
try
{
  String user = session.getUserID();
  String name = repository.getDescriptor(Repository.REP_NAME_DESC);
  System.out.println("Logged in as " + user + " to a " + name +  "repository.");
}
finally
{
  session.logout();
}

So if i run this, the initial default repository setup and file
structure is created. I have a repository directory, repository.xml
and the sub directories. 
The code above fails with the following exception :

javax.jcr.RepositoryException: failed to instantiate shared item state manager: failed to
write bundle: cafebabe-cafe-babe-cafe-babecafebabe: failed to write bundle: cafebabe-cafe-babe-cafe-babecafebabe
	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:1881)
	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1834)
	at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:483)
	at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:324)
	at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:621)
	at org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:235)
	at org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:255)
	at org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:323)
	at org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:378)
	...
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.jackrabbit.core.state.ItemStateException: failed to write bundle: cafebabe-cafe-babe-cafe-babecafebabe
	at org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.store(BundleDbPersistenceManager.java:544)
	at org.apache.jackrabbit.core.state.SharedItemStateManager.createRootNodeState(SharedItemStateManager.java:1311)
	at org.apache.jackrabbit.core.state.SharedItemStateManager.<init>(SharedItemStateManager.java:204)
	at org.apache.jackrabbit.core.RepositoryImpl.createItemStateManager(RepositoryImpl.java:1317)
	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:1863)
	... 14 more

I did not found any hint in the documentation. So i stepped through the code. And i found
that the following call fails : 
In class org.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex
in method getIndex(String) :

    protected int getIndex(String string) {
        try {
            Statement stmt = connectionManager.executeStmt(
                    indexSelectSQL, new Object[] { string });
            ResultSet rs = stmt.getResultSet();
            try {
                if (rs.next()) {
                    return rs.getInt(1);
                } else {
                    return -1;
                }
            } finally {
                rs.close();
            }
        } catch (Exception e) {
            IllegalStateException ise = new IllegalStateException(
                    "Unable to read index for string: " + string);
            ise.initCause(e);
            throw ise;
        }
    }

The indexSelectSQL string is 'select ID from DEFAULT_NAMES where NAME = ?'.
The call fails with java.sql.SQLException: Table/View 'DEFAULT_NAMES' does not exist. (btw.
why is this not logged ???)
So the big question is : How do i have to initialize the default
derby instance correctly ??? Is there an init() to call or something like that ?

Many many thanks for help in advance .

Andreas .

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

Mime
View raw message