jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Launay (JIRA) <j...@apache.org>
Subject [jira] Commented: (JCR-1879) "Directory was previously created with a different LockFactory" when open, close, delete a repository in a loop
Date Fri, 03 Apr 2009 14:42:14 GMT

    [ https://issues.apache.org/jira/browse/JCR-1879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695405#action_12695405
] 

S├ębastien Launay commented on JCR-1879:
---------------------------------------

After trying to reproduce the bug in a test case (which i was unable) i found that in my initial
test case (stack trace above) two repositories were simultaneously started.
Opening a session in the second repository will fail with a traditional "lock not acquired"
exception.
But opening a second session in this repository will acquire the lock but will throw the above
exception.

Indeed, the lock is checked when trying to create the first session, then the lock file is
deleted (RepositoryImpl.doShutdown() calls repLock.release()) because the session creation
fails.
The second session will not find a lock (previously removed) and then will fail with the lock
factory instance exception.

So, this is not the same bug and clearly a twisted case ;).
But i can create a new issue in order to avoid lock deletion if this is not the right repository.

> "Directory was previously created with a different LockFactory" when open, close, delete
a repository in a loop
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1879
>                 URL: https://issues.apache.org/jira/browse/JCR-1879
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.0
>         Environment: Mac OS X
>            Reporter: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Opening a TransientRepository in a loop throws the exception "Directory was previously
created with a different LockFactory instance".
> Test case:
> for (int i = 0; i < 3; i++) {
> 	FileUtils.deleteDirectory(new File("repository"));
> 	Repository rep = new TransientRepository();
> 	Session session = rep.login(new SimpleCredentials("", new char[0]));
> 	session.logout();
> }
> The problem seems to be that org.apache.lucene.store.FSDirectory.DIRECTORIES is not cleared
(FSDirectory.close() is not called?).
> Stack trace:
> Exception in thread "main" javax.jcr.RepositoryException: Directory was previously created
with a different LockFactory instance; please pass null as the lockFactory instance and use
setLockFactory to change it: Directory was previously created with a different LockFactory
instance; please pass null as the lockFactory instance and use setLockFactory to change it:
Directory was previously created with a different LockFactory instance; please pass null as
the lockFactory instance and use setLockFactory to change it
> 	at org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:555)
> 	at org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:239)
> 	at org.apache.jackrabbit.core.RepositoryImpl.getSystemSearchManager(RepositoryImpl.java:688)
> 	at org.apache.jackrabbit.core.RepositoryImpl.access$3(RepositoryImpl.java:681)
> 	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1780)
> 	at org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:667)
> 	at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:480)
> 	at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:321)
> 	at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:618)
> 	at org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:241)
> 	at org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:261)
> Caused by: java.io.IOException: Directory was previously created with a different LockFactory
instance; please pass null as the lockFactory instance and use setLockFactory to change it
> 	at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:192)
> 	at org.apache.jackrabbit.core.query.lucene.directory.FSDirectoryManager.getDirectory(FSDirectoryManager.java:64)
> 	at org.apache.jackrabbit.core.query.lucene.MultiIndex.<init>(MultiIndex.java:227)
> 	at org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:477)
> 	at org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:59)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message