You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Andreas Mucha <si...@gmx.net> on 2009/08/06 22:02:13 UTC

unable to start repository because of missing DEFAULT_NAMES table in derby backend

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

Re: Re: unable to start repository because of missing DEFAULT_NAMES table in derby backend

Posted by Andreas Mucha <si...@gmx.net>.
Ok,

i will trigger it :) .
Btw. i switched from the derby persistance manager to the filesystem 
persictance manager. This works .

-------- Original-Nachricht --------
> Datum: Fri, 7 Aug 2009 10:02:41 +0200
> Von: Stefan Guggisberg <st...@gmail.com>
> An: users@jackrabbit.apache.org
> Betreff: Re: unable to start repository because of missing DEFAULT_NAMES table 	in derby backend

> hi andreas
> 
> On Thu, Aug 6, 2009 at 10:02 PM, Andreas Mucha<si...@gmx.net> wrote:
> > 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 ???)
> 
> good point. feel free to create a jira issue. and, of course, patches
> are welcome! :)
> 
> > 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 ?
> 
> there's no need to setup/initialize the backend. that should be all
> taken care of automatically.
> 
> please create a jira issue and provide as much information as possible
> (logs, environment,
> steps to reproduce, etc).
> 
> thanks
> stefan
> 
> >
> > 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
> >

-- 
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02

Re: unable to start repository because of missing DEFAULT_NAMES table in derby backend

Posted by Stefan Guggisberg <st...@gmail.com>.
hi andreas

On Thu, Aug 6, 2009 at 10:02 PM, Andreas Mucha<si...@gmx.net> wrote:
> 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 ???)

good point. feel free to create a jira issue. and, of course, patches
are welcome! :)

> 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 ?

there's no need to setup/initialize the backend. that should be all
taken care of automatically.

please create a jira issue and provide as much information as possible
(logs, environment,
steps to reproduce, etc).

thanks
stefan

>
> 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
>