You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Christine Morineau <ch...@bull.net> on 2005/08/25 19:12:41 UTC
'Lock obtain timed out' and redo log
Hi all,
Sometimes, I get a javax.jcr.RepositoryException: Lock obtain timed out
when for exemple the application try to add a Node in the workspace. My
repository seems to be unreachable.
Do you know why I get this error and what to do not to have it again.
The trace of the error is at the end.
I also get the message 'found uncommited redo log...' (and even twice).
I presume that my search index is not closed properly. But how to close it
properly?
Is a session.logout() enough and where should i put it?
Thanks
regards
christine
javax.jcr.RepositoryException: Lock obtain timed out: Lock@commit.lock: Lock
obtain timed out: Lock@
commit.lock: Lock obtain timed out: Lock@commit.lock
at
org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:124)
at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(Rep
ositoryImpl.j
ava:1130)
at
org.apache.jackrabbit.core.RepositoryImpl.getSearchManager(RepositoryImpl.ja
va:536)
at
org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:
398)
at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:293)
at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:344)
at
org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.j
ava:116)
at
org.apache.jackrabbit.core.jndi.BindableRepository.create(BindableRepository
.java:104)
at
org.apache.jackrabbit.core.jndi.RegistryHelper.registerRepository(RegistryHe
lper.java:57)
at bsoa.resourceAdapter.RepositoryResourceAdapter.start(Unknown
Source)
at org.objectweb.jonas.resource.Rar.processRar(Rar.java:546)
at
org.objectweb.jonas.resource.ResourceServiceImpl.createResourceAdapter(Resou
rceServiceImp
l.java:639)
at
org.objectweb.jonas.resource.ResourceServiceImpl.doStart(ResourceServiceImpl
.java:489)
at
org.objectweb.jonas.service.AbsServiceImpl.start(AbsServiceImpl.java:80)
at
org.objectweb.jonas.service.ServiceManager.startServices(ServiceManager.java
:336)
at org.objectweb.jonas.server.Server.start(Server.java:499)
at org.objectweb.jonas.server.Server.main(Server.java:169)
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:324)
at org.objectweb.jonas.server.Bootstrap.main(Bootstrap.java:97)
Caused by: java.io.IOException: Lock obtain timed out: Lock@commit.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:58)
at org.apache.lucene.store.Lock$With.run(Lock.java:108)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:228)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:213)
at
org.apache.jackrabbit.core.query.lucene.AbstractIndex.getIndexWriter(Abstrac
tIndex.java:1
47)
at
org.apache.jackrabbit.core.query.lucene.AbstractIndex.addDocument(AbstractIn
dex.java:102)
at
org.apache.jackrabbit.core.query.lucene.MultiIndex.addNodePersistent(MultiIn
dex.java:477)
at
org.apache.jackrabbit.core.query.lucene.MultiIndex.<init>(MultiIndex.java:20
9)
at
org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:
83)
at
org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHand
ler.java:39)
at
org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:122)
... 21 more
java.io.IOException: Lock obtain timed out: Lock@commit.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:58)
at org.apache.lucene.store.Lock$With.run(Lock.java:108)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:228)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:213)
at
org.apache.jackrabbit.core.query.lucene.AbstractIndex.getIndexWriter(Abstrac
tIndex.java:1
47)
at
org.apache.jackrabbit.core.query.lucene.AbstractIndex.addDocument(AbstractIn
dex.java:102)
at
org.apache.jackrabbit.core.query.lucene.MultiIndex.addNodePersistent(MultiIn
dex.java:477)
at
org.apache.jackrabbit.core.query.lucene.MultiIndex.<init>(MultiIndex.java:20
9)
at
org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:
83)
at
org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHand
ler.java:39)
at
org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:122)
at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(Rep
ositoryImpl.j
ava:1130)
at
org.apache.jackrabbit.core.RepositoryImpl.getSearchManager(RepositoryImpl.ja
va:536)
at
org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:
398)
at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:293)
at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:344)
at
org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.j
ava:116)
at
org.apache.jackrabbit.core.jndi.BindableRepository.create(BindableRepository
.java:104)
at
org.apache.jackrabbit.core.jndi.RegistryHelper.registerRepository(RegistryHe
lper.java:57)
at bsoa.resourceAdapter.RepositoryResourceAdapter.start(Unknown
Source)
at org.objectweb.jonas.resource.Rar.processRar(Rar.java:546)
at
org.objectweb.jonas.resource.ResourceServiceImpl.createResourceAdapter(Resou
rceServiceImp
l.java:639)
at
org.objectweb.jonas.resource.ResourceServiceImpl.doStart(ResourceServiceImpl
.java:489)
at
org.objectweb.jonas.service.AbsServiceImpl.start(AbsServiceImpl.java:80)
at
org.objectweb.jonas.service.ServiceManager.startServices(ServiceManager.java
:336)
at org.objectweb.jonas.server.Server.start(Server.java:499)
at org.objectweb.jonas.server.Server.main(Server.java:169)
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:324)
at org.objectweb.jonas.server.Bootstrap.main(Bootstrap.java:97)
Re: 'Lock obtain timed out' and redo log
Posted by Marcel Reutegger <ma...@gmx.net>.
Dave Sag wrote:
> how exactly do you make sure that jackrabbit is stopped. we have been
> getting this same warning after running unit tests of our code.
RepositoryImpl.shutdown() will shutdown everything smoothly.
There is also a safety net built into the RepositoryImpl class which is
basically a shutdown hook that is registered. but it seems that there
are cases where that hook is not called.
anyway, explicitly calling shutdown() is in my opinion the prefered way
to stop the repository.
regards
marcel
Re: 'Lock obtain timed out' and redo log
Posted by Dave Sag <ds...@visualitylife.com>.
On 26/08/2005, at 10:10 AM, Marcel Reutegger wrote:
> The search index is tied to a workspace. therefore closing a
> session has no effect on the index.
> To prevent messages like above you have to make sure that
> jackrabbit is stopped properly when your server shuts down.
how exactly do you make sure that jackrabbit is stopped. we have
been getting this same warning after running unit tests of our code.
dave
Re: 'Lock obtain timed out' and redo log
Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Christine,
Christine Morineau wrote:
> Sometimes, I get a javax.jcr.RepositoryException: Lock obtain timed out
> when for exemple the application try to add a Node in the workspace. My
> repository seems to be unreachable.
There are two reasons why this can happen.
- you are using a an old build jackrabbit (svn < 216142 / juli 13). the
indicated revision contains a fix in case a commit lock is left behind.
- two repositories instances are running on the same directory
> I also get the message 'found uncommited redo log...' (and even twice).
this happens when the jvm quits without shutting down jackrabbit. If you
get the message you mentioned twice, that means you have two workspaces
or jackrabbit instances with uncommited index changes. usually the
search index can easily recover from this situation, unless the
underlying workspace data is corrupt.
> I presume that my search index is not closed properly. But how to close it
> properly?
That's usually the duty of the application server or servlet engine,
which manages resources.
> Is a session.logout() enough and where should i put it?
The search index is tied to a workspace. therefore closing a session has
no effect on the index.
To prevent messages like above you have to make sure that jackrabbit is
stopped properly when your server shuts down.
regards
marcel