jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger (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 Wed, 22 Apr 2009 15:23:47 GMT

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

Marcel Reutegger commented on JCR-1879:
---------------------------------------

There is some confusion about issues related to this exception message. *This* issue fixes
a bug that was only present in jackrabbit-core trunk and was never released. The issue you're
interested in is probably JCR-2057.

> "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