jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: OverlappingFileLockException using DerbyPersistenceManager
Date Mon, 19 Feb 2007 16:28:17 GMT
ok, i guess we can rule derby out.

it seems like the same process/jvm tries to acquire a file lock
on the repository .lock file.

you should see a related warning in your jackrabbit log file.

try the following:

            Repository rep1 = new TransientRepository();
            Session s1 = rep1.login(new SimpleCredentials("johndoe",
"".toCharArray()));
            Repository rep2 = new TransientRepository();
            Session s2 = rep2.login(new SimpleCredentials("johndoe",
"".toCharArray()));

the last call should trigger an exception (which is legitimate and correct).

however, the OverlappingFileLockException is probably only thrown on linux.
at least i couldn't reproduce it on a windows box.

the lock file should prevent multiple repository instantiation with
identical parameters.
and that's probably your issue...

cheers
stefan



On 2/19/07, Patrick Haggood <codezilla@email.com> wrote:
> On Mon, 2007-02-19 at 15:57 +0100, Stefan Guggisberg wrote:
> > On 2/19/07, Patrick Haggood <codezilla@email.com> wrote:
> > > I'm using Linux, Sun Java 6 and Jackrabbit 1.3 with Derby persistance.
> > > I have a putNode(object) function that's giving the above error in unit
> > > tests.  It always fails after the second update, even when I swap tests
> > > (i.e. save user doc then save user).  Prior to each test, I delete the
> > > repository directory.
> > >
> > > Do I need to set explicit locks before/after each session.save()?
> >
> > no. my first guess is that this is a platform-related issue (linux/jre6).
> > could you please provide a full stacktrace of the exception thrown?
> > did you find any hint in the derby.log?
> > do you have a chance to test on a different platform?
> > cheers
> > stefan
> >
>
> 1) Stacktrace below
> 2) Derby log below
> 3) Don't have another platform handy; will try to scrounge up a Win box.
>
>
> ************* Stacktrace
>
> Exception in constructor: testPutUnityDocument
> (java.nio.channels.OverlappingFileLockException
>         at sun.nio.ch.FileChannelImpl
> $SharedFileLockTable.checkList(FileChannelImpl.java:1173)
>         at sun.nio.ch.FileChannelImpl
> $SharedFileLockTable.add(FileChannelImpl.java:1075)
>         at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:881)
>         at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.acquireRepositoryLock(RepositoryImpl.java:316)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:197)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:483)
>         at org.apache.jackrabbit.core.TransientRepository
> $2.getRepository(TransientRepository.java:241)
>         at
> org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:261)
>         at
> org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:329)
>         at
> org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:359)
>         at unityjsr170.jr.SessionUtil.<init>(SessionUtil.java:65)
>         at unityjsr170.jr.DBConn.<init>(DBConn.java:65)
>         at
> unityjsr170.jr.SessionUtilTest.<init>(SessionUtilTest.java:62)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at
> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at junit.framework.TestSuite.createTest(TestSuite.java:135)
>         at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
>         at junit.framework.TestSuite.<init>(TestSuite.java:75)
>         at unityjsr170.jr.SessionUtilTest.suite(SessionUtilTest.java:72)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:272)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
> )
> junit.framework.AssertionFailedError: Exception in constructor:
> testPutUnityDocument (java.nio.channels.OverlappingFileLockException
>         at sun.nio.ch.FileChannelImpl
> $SharedFileLockTable.checkList(FileChannelImpl.java:1173)
>         at sun.nio.ch.FileChannelImpl
> $SharedFileLockTable.add(FileChannelImpl.java:1075)
>         at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:881)
>         at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.acquireRepositoryLock(RepositoryImpl.java:316)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:197)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:483)
>         at org.apache.jackrabbit.core.TransientRepository
> $2.getRepository(TransientRepository.java:241)
>         at
> org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:261)
>         at
> org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:329)
>         at
> org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:359)
>         at unityjsr170.jr.SessionUtil.<init>(SessionUtil.java:65)
>         at unityjsr170.jr.DBConn.<init>(DBConn.java:65)
>         at
> unityjsr170.jr.SessionUtilTest.<init>(SessionUtilTest.java:62)
>         at
> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at unityjsr170.jr.SessionUtilTest.suite(SessionUtilTest.java:72)
> )
>
>
> Testcase: warning(junit.framework.TestSuite$1): FAILED
> Exception in constructor: testPutUnityFolder
> (java.nio.channels.OverlappingFileLockException
>         at sun.nio.ch.FileChannelImpl
> $SharedFileLockTable.checkList(FileChannelImpl.java:1173)
>         at sun.nio.ch.FileChannelImpl
> $SharedFileLockTable.add(FileChannelImpl.java:1075)
>         at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:881)
>         at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.acquireRepositoryLock(RepositoryImpl.java:316)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:197)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:483)
>         at org.apache.jackrabbit.core.TransientRepository
> $2.getRepository(TransientRepository.java:241)
>         at
> org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:261)
>         at
> org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:329)
>         at
> org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:359)
>         at unityjsr170.jr.SessionUtil.<init>(SessionUtil.java:65)
>         at unityjsr170.jr.DBConn.<init>(DBConn.java:65)
>         at
> unityjsr170.jr.SessionUtilTest.<init>(SessionUtilTest.java:62)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at
> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at junit.framework.TestSuite.createTest(TestSuite.java:135)
>         at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
>         at junit.framework.TestSuite.<init>(TestSuite.java:75)
>         at unityjsr170.jr.SessionUtilTest.suite(SessionUtilTest.java:72)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:272)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
> )
> junit.framework.AssertionFailedError: Exception in constructor:
> testPutUnityFolder (java.nio.channels.OverlappingFileLockException
>         at sun.nio.ch.FileChannelImpl
> $SharedFileLockTable.checkList(FileChannelImpl.java:1173)
>         at sun.nio.ch.FileChannelImpl
> $SharedFileLockTable.add(FileChannelImpl.java:1075)
>         at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:881)
>         at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.acquireRepositoryLock(RepositoryImpl.java:316)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:197)
>         at
> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:483)
>         at org.apache.jackrabbit.core.TransientRepository
> $2.getRepository(TransientRepository.java:241)
>         at
> org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:261)
>         at
> org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:329)
>         at
> org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:359)
>         at unityjsr170.jr.SessionUtil.<init>(SessionUtil.java:65)
>         at unityjsr170.jr.DBConn.<init>(DBConn.java:65)
>         at
> unityjsr170.jr.SessionUtilTest.<init>(SessionUtilTest.java:62)
>         at
> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at unityjsr170.jr.SessionUtilTest.suite(SessionUtilTest.java:72)
> )
>
>
> ************* Derby Log
> ----------------------------------------------------------------
> 2007-02-19 07:08:46.662 GMT:
>  Booting Derby version The Apache Software Foundation - Apache Derby -
> 10.1.2.1 - (330608): instance c013800d-0110-d8d4-c21c-000000413180
> on database
> directory /home/pbh/projects/lab/javadev/nbprojects/UnityJSR170/repository/version/db
>
> Database Class Loader started - derby.database.classpath=''
> ----------------------------------------------------------------
> 2007-02-19 07:08:48.424 GMT:
>  Booting Derby version The Apache Software Foundation - Apache Derby -
> 10.1.2.1 - (330608): instance 6074401f-0110-d8d4-c21c-000000413180
> on database
> directory /home/pbh/projects/lab/javadev/nbprojects/UnityJSR170/repository/workspaces/default/db
>
> Database Class Loader started - derby.database.classpath=''
>
>
>

Mime
View raw message