You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Thomas Fromm <tf...@inubit.com> on 2009/10/19 13:41:22 UTC

H2 Persistence Manager problem

Hi,

today I configured H2 for both persistence managers (versioning and 
workspace), but at startup I get:

Cannot instantiate persistence manager org.apache.jackra
bbit.core.persistence.bundle.H2PersistenceManager: 
{http://www.jcp.org/jcr/mix/1.0}referenceable
javax.jcr.RepositoryException: Cannot instantiate persistence manager 
org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager: 
{http://www.j
cp.org/jcr/mix/1.0}referenceable: 
{http://www.jcp.org/jcr/mix/1.0}referenceable
        at 
org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1328)
        at 
org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:459)
        at 
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:319)
...

Caused by: javax.jcr.nodetype.NoSuchNodeTypeException: 
{http://www.jcp.org/jcr/mix/1.0}referenceable
        at 
org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.getEffectiveNodeType(NodeTypeRegistry.java:1024)
        at 
org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.getEffectiveNodeType(NodeTypeRegistry.java:471)
        at 
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.init(AbstractBundlePersistenceManager.java:416)
        at 
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:598)
        at 
org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager.init(H2PersistenceManager.java:91)
        at 
org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1324)
        ... 33 more


The configuration e.g. for versioning looks like this:

 <PersistenceManager 
class="org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager">
     <param name="bundleCacheSize" value="8"/>
     <param name="consistencyCheck" value="true"/>
        <param name="consistencyFix" value="true"/>
     <param name="minBlobSize" value="16384"/>
     <param name="driver" value="org.h2.Driver"/>
     <param name="url" value="jdbc:h2:file:${rep.home}/version/database"/>
     <param name="user" value="sa"/>
     <param name="password" value=""/>
     <param name="schema" value="h2"/>
     <param name="schemaObjectPrefix" value=""/>
     <param name="errorHandling" value=""/>
     <param name="lockTimeout" value="10000"/>
 </PersistenceManager>

Any ideas how to fix the problem?

--tf

Re: H2 Persistence Manager problem

Posted by Thomas Fromm <tf...@inubit.com>.
Hi,

On Monday 19 October 2009 17:20, Thomas Müller wrote:
> I can't reproduce the problem. Everything works for me. I guess you
> have an old Jackrabbit jar file somewhere in your classpath. My test
> case:


I found the problem.
The Problem was a missing .cnd file which contained the node types 
definitions. :-/

Sorry for the circumstances!

--tf

Re: H2 Persistence Manager problem

Posted by Thomas Fromm <tf...@inubit.com>.
> I can't reproduce the problem. Everything works for me. I guess you
> have an old Jackrabbit jar file somewhere in your classpath. My test
> case:

The only difference I can see at the first sight is, that I use
RepositoryConfig.create(...) to create the configuration and use this as 
parameter for TransientRepository.

No older versions of jackrabbit or the listed other components can be found 
inside this Tomcat...
Hm. 

Re: H2 Persistence Manager problem

Posted by Thomas Müller <th...@day.com>.
Hi,

I can't reproduce the problem. Everything works for me. I guess you
have an old Jackrabbit jar file somewhere in your classpath. My test
case:

import javax.jcr.*;
import org.apache.jackrabbit.core.TransientRepository;
public class Test {
    public static void main(String... args) throws Exception {
        System.setProperty("log4j.configuration", "file:log4j.xml");
        Repository repository = new TransientRepository();
        Session session = repository.login(new SimpleCredentials("",
"".toCharArray()));
        Node root = session.getRootNode();
        Node n = root.hasNode("test") ? root.getNode("test") :
root.addNode("test");
        n.setProperty("test", "abc");
        session.save();
        session.logout();
    }
}

Jar files:

commons-collections-3.1.jar
commons-io-1.4.jar
concurrent-1.3.4.jar
h2-1.2.121.jar
jackrabbit-api-1.6.0.jar
jackrabbit-core-1.6.0.jar
jackrabbit-jcr-commons-1.6.0.jar
jackrabbit-spi-1.6.0.jar
jackrabbit-spi-commons-1.6.0.jar
jackrabbit-text-extractors-1.6.0.jar
jcr-1.0.jar
log4j-1.2.14.jar
lucene-core-2.4.1.jar
slf4j-api-1.5.3.jar
slf4j-log4j12-1.5.3.jar

repository.xml: the same as your, except i replaced

<!--	<LoginModule
class="com.inubit.ibis.server.repository.IBISLoginModule"/> -->

with

        <LoginModule
class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
           <param name="anonymousId" value="anonymous"/>
           <param name="adminId" value="admin"/>
        </LoginModule>

Log output:

19.10.2009 17:13:18 *INFO * RepositoryImpl: Starting repository...
(RepositoryImpl.java, line 261)
19.10.2009 17:13:18 *INFO * LocalFileSystem: LocalFileSystem
initialized at path repository/repository (LocalFileSystem.java, line
166)
19.10.2009 17:13:18 *INFO * NodeTypeRegistry: no custom node type
definitions found (NodeTypeRegistry.java, line 852)
19.10.2009 17:13:18 *INFO * LocalFileSystem: LocalFileSystem
initialized at path repository/version (LocalFileSystem.java, line
166)
19.10.2009 17:13:19 *INFO * ConnectionRecoveryManager: Database: H2 /
1.2.121 (2009-10-11) (ConnectionRecoveryManager.java, line 345)
19.10.2009 17:13:19 *INFO * ConnectionRecoveryManager: Driver: H2 JDBC
Driver / 1.2.121 (2009-10-11) (ConnectionRecoveryManager.java, line
346)
19.10.2009 17:13:19 *INFO * BundleDbPersistenceManager: version:
checking workspace consistency... (BundleDbPersistenceManager.java,
line 805)
19.10.2009 17:13:19 *INFO * BundleDbPersistenceManager: version:
checked 1/1 bundles. (BundleDbPersistenceManager.java, line 958)
19.10.2009 17:13:19 *INFO * RepositoryImpl: initializing workspace
'ibis'... (RepositoryImpl.java, line 1918)
19.10.2009 17:13:19 *INFO * LocalFileSystem: LocalFileSystem
initialized at path repository/workspaces/ibis (LocalFileSystem.java,
line 166)
19.10.2009 17:13:19 *INFO * ConnectionRecoveryManager: Database: H2 /
1.2.121 (2009-10-11) (ConnectionRecoveryManager.java, line 345)
19.10.2009 17:13:19 *INFO * ConnectionRecoveryManager: Driver: H2 JDBC
Driver / 1.2.121 (2009-10-11) (ConnectionRecoveryManager.java, line
346)
19.10.2009 17:13:19 *INFO * BundleDbPersistenceManager: ibis: checking
workspace consistency... (BundleDbPersistenceManager.java, line 805)
19.10.2009 17:13:19 *INFO * BundleDbPersistenceManager: ibis: checked
3/3 bundles. (BundleDbPersistenceManager.java, line 958)
19.10.2009 17:13:19 *INFO * SearchIndex: Index initialized:
repository/repository/index Version: 3 (SearchIndex.java, line 540)
19.10.2009 17:13:19 *INFO * SearchIndex: Index initialized:
repository/workspaces/ibis/index Version: 3 (SearchIndex.java, line
540)
19.10.2009 17:13:19 *INFO * RepositoryImpl: workspace 'ibis'
initialized (RepositoryImpl.java, line 1922)
19.10.2009 17:13:19 *INFO * RepositoryImpl: Repository started
(RepositoryImpl.java, line 366)
19.10.2009 17:13:19 *INFO * TransientRepository: Transient repository
initialized (TransientRepository.java, line 252)
19.10.2009 17:13:19 *INFO * SimpleSecurityManager: init: using
Repository LoginModule configuration for Jackrabbit
(SimpleSecurityManager.java, line 114)
19.10.2009 17:13:19 *INFO * RepositoryImpl: SecurityManager = class
org.apache.jackrabbit.core.security.simple.SimpleSecurityManager
(RepositoryImpl.java, line 441)
19.10.2009 17:13:19 *INFO * TransientRepository: Session opened
(TransientRepository.java, line 327)
19.10.2009 17:13:19 *INFO * TransientRepository: Session closed
(TransientRepository.java, line 422)
19.10.2009 17:13:19 *INFO * RepositoryImpl: Shutting down
repository... (RepositoryImpl.java, line 1093)
19.10.2009 17:13:19 *INFO * IndexMerger: IndexMerger terminated
(IndexMerger.java, line 341)
19.10.2009 17:13:19 *INFO * SearchIndex: Index closed:
repository/repository/index (SearchIndex.java, line 728)
19.10.2009 17:13:19 *INFO * RepositoryImpl: shutting down workspace
'ibis'... (RepositoryImpl.java, line 2068)
19.10.2009 17:13:19 *INFO * ObservationDispatcher: Notification of
EventListeners stopped. (ObservationDispatcher.java, line 106)
19.10.2009 17:13:19 *INFO * IndexMerger: IndexMerger terminated
(IndexMerger.java, line 341)
19.10.2009 17:13:19 *INFO * SearchIndex: Index closed:
repository/workspaces/ibis/index (SearchIndex.java, line 728)
19.10.2009 17:13:19 *INFO * RepositoryImpl: workspace 'ibis' has been
shutdown (RepositoryImpl.java, line 2074)
19.10.2009 17:13:19 *INFO * RepositoryImpl: Repository has been
shutdown (RepositoryImpl.java, line 1185)
19.10.2009 17:13:19 *INFO * TransientRepository: Transient repository
shut down (TransientRepository.java, line 262)

Regards,
Thomas

Re: H2 Persistence Manager problem

Posted by Thomas Fromm <tf...@inubit.com>.
> Log and configuration file attached.

Forgot to add log of org.apache.jackrabbit for the startup time....




Re: H2 Persistence Manager problem

Posted by Thomas Fromm <tf...@inubit.com>.
On Monday 19 October 2009 15:50, Thomas Müller wrote:
> So this exception occurred when creating the repository, right? The
> repository directory is empty before you start the application?

Both right.

> Could you post the log file, the configuration (repository.xml and all
> workspace.xml files), as well as the list of Jackrabbit jar files you
> use?

Log and configuration file attached.

Used Jars:
jackrabbit-core-1.6.0.jar
jackrabbit-jcr-commons-1.6.0.jar
jackrabbit-api-1.6.0.jar
jackrabbit-text-extractors-1.6.0.jar
jackrabbit-spi-commons-1.6.0.jar
jackrabbit-spi-1.6.0.jar
jcr-1.0.jar


Re: H2 Persistence Manager problem

Posted by Thomas Müller <th...@day.com>.
Hi,

> It is an fresh installation :-|

So this exception occurred when creating the repository, right? The
repository directory is empty before you start the application?

Could you post the log file, the configuration (repository.xml and all
workspace.xml files), as well as the list of Jackrabbit jar files you
use?

Regards,
Thomas

Re: H2 Persistence Manager problem

Posted by Thomas Fromm <tf...@inubit.com>.
> the persistence manager. It looks like the built-in nodetype
> "jcr:referenceable" doesn't exists in your installation. Could you try
> using a new (fresh) repository?

It is an fresh installation :-|

Normally I used the XMLPersistenceManager. But now I want to try the H2 one.

As FileSystem I use org.apache.jackrabbit.core.fs.local.LocalFileSystem.


Re: H2 Persistence Manager problem

Posted by Thomas Müller <th...@day.com>.
Hi,

I'm not sure what the problem is, but I don't think it is related to
the persistence manager. It looks like the built-in nodetype
"jcr:referenceable" doesn't exists in your installation. Could you try
using a new (fresh) repository?

Regards,
Thomas


On Mon, Oct 19, 2009 at 2:03 PM, Thomas Fromm <tf...@inubit.com> wrote:
>
>> today I configured H2 for both persistence managers (versioning and
>> workspace), but at startup I get:
>
> The used Jackrabbit version is 1.6.
>

Re: H2 Persistence Manager problem

Posted by Thomas Fromm <tf...@inubit.com>.
> today I configured H2 for both persistence managers (versioning and
> workspace), but at startup I get:

The used Jackrabbit version is 1.6.