jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tako Schotanus" <quinte...@gmail.com>
Subject Repository in use on Glassfish...
Date Thu, 02 Oct 2008 16:00:37 GMT
I've got a problem that a web app trying to use a Jackrabbit JCR repository
obtained via JNDI will always throw the following exception after the first
time:

javax.jcr.RepositoryException: The repository home C:\jcr-test-repo appears
to be in use since the file named .lock is already locked by the current
process.
        at
org.apache.jackrabbit.core.util.RepositoryLock.tryLock(RepositoryLock.java:142)
        at
org.apache.jackrabbit.core.util.RepositoryLock.acquire(RepositoryLock.java:121)
        at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:241)
        at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:557)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:174)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:138)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.create(BindableRepository.java:125)
        at
org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.createInstance(BindableRepositoryFactory.java:59)
        at
org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:81)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:403)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at org.apache.jsp.dump_jsp._jspService(dump_jsp.java from :253)
        ..... (the rest just isn't very interesting)

So the very first time the Repository object is obtained correctly but after
that it just won't work anymore.

This is using the latest Glassfish v2 and Java 6 versions.

I found threads describing similar problems, like this one saying that it
didn't work with Java 6:

    http://thread.gmane.org/gmane.comp.apache.jackrabbit.user/4366

but changing to Java 5 didn't change anything.

The configuration of the JNDI is done configuring a "Custom Resource" using
the Administration Console:

    Resource Type: javax.jcr.Repository
    Factory Class: org.apache.jackrabbit.core.jndi.BindableRepositoryFactory

The following code is sufficient to reproduce the error:

    InitialContext context = new InitialContext();
    Repository repository = (Repository) context.lookup("jcr/repository");

Talked to Jukka and he said that it looked like if the application server
was trying to make a new Repository object for each call, which should not
happen of course. But I have no idea if that's true or how to check it.

So, does anybody have any idea what is wrong? Are there any others using
Glassfish and JNDI via de Admin Console?

Thanks,
 -Tako

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