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 Mon, 16 Mar 2009 11:02:50 GMT

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

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

I have the same exception using Jackrabbit 1.5.3 and Lucene 2.3.2:
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.PersistentIndex.<init>(PersistentIndex.java:63)
	at org.apache.jackrabbit.core.query.lucene.MultiIndex.getOrCreateIndex(MultiIndex.java:587)
	at org.apache.jackrabbit.core.query.lucene.MultiIndex$CreateIndex.execute(MultiIndex.java:1675)
	at org.apache.jackrabbit.core.query.lucene.MultiIndex.executeAndLog(MultiIndex.java:972)
	at org.apache.jackrabbit.core.query.lucene.MultiIndex.commitVolatileIndex(MultiIndex.java:1017)
	at org.apache.jackrabbit.core.query.lucene.MultiIndex.flush(MultiIndex.java:862)
	at org.apache.jackrabbit.core.query.lucene.Recovery.run(Recovery.java:172)
	at org.apache.jackrabbit.core.query.lucene.Recovery.run(Recovery.java:85)
	at org.apache.jackrabbit.core.query.lucene.MultiIndex.<init>(MultiIndex.java:311)
	at org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:456)
	at org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:59)
	at org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:553)
	at org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:239)
	at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1761)
	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$1.getRepository(TransientRepository.java:187)
	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 org.ametys.plugins.oswf.store.JackrabbitWorkflowStore._getSession(JackrabbitWorkflowStore.java:142)
	at org.ametys.plugins.oswf.store.JackrabbitWorkflowStore.moveToHistory(JackrabbitWorkflowStore.java:778)
	at com.opensymphony.workflow.AbstractWorkflow.createNewCurrentStep(AbstractWorkflow.java:1474)
	at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1256)
	at com.opensymphony.workflow.AbstractWorkflow.doAction(AbstractWorkflow.java:567)
	at org.ametys.plugins.oswf.store.AbstractFunctionalWorkflowTest.testExampleWorkflow(AbstractFunctionalWorkflowTest.java:124)
	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 junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

In my test case, i create lots of workflows and they creates lots of JCR sessions.
If i use a pool of sessions, i can not reproduce this issue.

So, this issue also affect the 1.5 branch and a new merge :) will be greatly appreciated...

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