You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Dennis van der Laan <d....@rug.nl> on 2009/12/16 00:05:19 UTC

Unable to start second node in a cluster

Hi,

I have two identical machines (A and B) running Jackrabbit 1.6.0 on
Tomcat 6.0. I made an empty folder on each machine, containing only a
repository.xml file, again both identical (using System properties to
set the cluster ID). The repository configuration uses a bundle PM
(Oracle 10g database) and a local filesystem for all components.

When I start A, the repository tables are created in the database and
all works well. After the repository is initialized, I add some custom
namespaces and nodetypes, and create a basic folder hierarchy.
Then, when I start B, I get the following exception:

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)

When I stop both A and B, and starting them again, A can startup again
but B still gives the exception.

I removed all tables from the database and re-created the repository
folders on both machines and inverted the startup: first I started B and
then I started A. Now B starts up fine, but A gives the exception.

In the LOCAL_REVISIONS table I can see both cluster instances add their
revision (revision 12 for the started repository and 0 for the failed
repository).

What am I doing wrong here? I found an issue involving LockFactory
exceptions, but they all had to do with starting and stopping multiple
repositories in the same VM or concurrently on the same machine.

Thanks,
Dennis

-- 
Dennis van der Laan


Re: Unable to start second node in a cluster

Posted by Dennis van der Laan <d....@rug.nl>.
No, we're not using a shared filesystem between the cluster nodes. The
only things shared between the cluster nodes are the persistence manager
and the datastore. Could it be Lucene creates a lock-file and that
lock-file ends up in the datastore or persistence manager, instead of on
the local filesystem? Where is the FSDirectory of Lucene located?

Dennis
> The only thing I can think of is that Lucene left a lock file
> somewhere but I have no clue why it should do that... It is strange
> that this happens with the bundle PM and not with the regular DB PM.
> You don't use a filsystem which is shared between the cluster nodes,
> do you?
>
> Martijn
>
> On Wed, Dec 16, 2009 at 10:37 AM, Dennis van der Laan
> <d....@rug.nl> wrote:
>   
>> Hi Martijn,
>>     
>>> We often use a bundle db PM in a cluster and I've never seen the
>>> problem you describe. It woul help if you can provide more detailed
>>> logging, and which version of Jackrabbit are you using?
>>>
>>>
>>>       
>> See below for our configuration file and some more error logging. Note
>> that the System property "ucms.cluster.id" is different for each cluster
>> node, the rest of the used properties have the same values for all
>> cluster nodes. As said, changing the bundle.OraclePersistenceManager to
>> a db.OraclePersistenceManager fixes the problem, but is not what I want...
>>
>> Thanks,
>> Dennis
>>
>> === repository.xml ===
>>
>> <?xml version="1.0"?>
>> <!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD
>> Jackrabbit 1.5//EN"
>>
>> "http://jackrabbit.apache.org/dtd/repository-1.5.dtd">
>> <Repository>
>>    <Cluster id="${ucms.cluster.id}">
>>        <Journal
>> class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">
>>            <param name="revision" value="${rep.home}/revision.log" />
>>            <param name="driver" value="oracle.jdbc.driver.OracleDriver" />
>>            <param name="url" value="${ucms.cluster.db.url}" />
>>            <param name="user" value="${ucms.cluster.db.user}"/>
>>            <param name="password" value="${ucms.cluster.db.passwd}"/>
>>        </Journal>
>>    </Cluster>
>>
>>    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>>        <param name="path" value="${rep.home}/repository"/>
>>    </FileSystem>
>>
>>    <Security appName="Jackrabbit">
>>        <SecurityManager
>> class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
>> workspaceName="security" />
>>        <AccessManager
>> class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager" />
>>        <LoginModule
>> class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
>>           <param name="anonymousId" value="anonymous"/>
>>           <param name="adminId" value="admin"/>
>>        </LoginModule>
>>    </Security>
>>
>>    <Workspaces rootPath="${rep.home}/workspaces"
>> defaultWorkspace="default"/>
>>
>>    <Workspace name="${wsp.name}">
>>        <FileSystem
>> class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>>            <param name="path" value="${wsp.home}"/>
>>        </FileSystem>
>>
>>        <PersistenceManager
>> class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
>>            <param name="url" value="${ucms.cluster.db.url}"/>
>>            <param name="user" value="${ucms.cluster.db.user}"/>
>>            <param name="password" value="${ucms.cluster.db.passwd}"/>
>>            <param name="schemaObjectPrefix" value="${wsp.name}_"/>
>>            <param name="bundleCacheSize" value="8"/>
>>        </PersistenceManager>
>>
>>        <SearchIndex
>> class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>>            <param name="path" value="${wsp.home}/index"/>
>>            <param name="textFilterClasses"
>> value="org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
>>            <param name="extractorPoolSize" value="2"/>
>>            <param name="supportHighlighting" value="true"/>
>>        </SearchIndex>
>>    </Workspace>
>>
>>    <Versioning rootPath="${rep.home}/version">
>>        <FileSystem
>> class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>>            <param name="path" value="${rep.home}/version" />
>>        </FileSystem>
>>
>>        <PersistenceManager
>> class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
>>            <param name="url" value="${ucms.cluster.db.url}"/>
>>            <param name="user" value="${ucms.cluster.db.user}"/>
>>            <param name="password" value="${ucms.cluster.db.passwd}"/>
>>            <param name="schemaObjectPrefix" value="version_"/>
>>            <param name="bundleCacheSize" value="8"/>
>>        </PersistenceManager>
>>    </Versioning>
>>
>>    <SearchIndex
>> class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>>        <param name="path" value="${rep.home}/repository/index"/>
>>        <param name="textFilterClasses"
>> value="org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
>>        <param name="extractorPoolSize" value="2"/>
>>        <param name="supportHighlighting" value="true"/>
>>    </SearchIndex>
>>
>>    <!-- DataStore configuration -->
>>    <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
>>        <param name="driver" value="oracle.jdbc.OracleDriver"/>
>>        <param name="url" value="${ucms.cluster.db.url}"/>
>>        <param name="user" value="${ucms.cluster.db.user}"/>
>>        <param name="password" value="${ucms.cluster.db.passwd}"/>
>>        <param name="minRecordLength" value="1024"/>
>>        <param name="maxConnections" value="8"/>
>>     
>
>   
>>        <param name="copyWhenReading" value="true"/>
>>    </DataStore>
>> </Repository>
>>
>> === error message ===
>>
>> 2009-12-15 22:50:33,948 ERROR
>> [org.apache.jackrabbit.core.RepositoryImpl] - failed to start
>> Repository: Directory was previously created with a differ
>> ent LockFactory instance; please pass null as the lockFactory instance
>> and use setLockFactory to change it: Directory was previously created
>> with a di
>> fferent LockFactory instance; please pass null as the lockFactory
>> instance and use setLockFactory to change it
>> javax.jcr.RepositoryException: Directory was previously created with a
>> different LockFactory instance; please pass null as the lockFactory
>> instance an
>> d use setLockFactory to change it: Directory was previously created with
>> a different LockFactory instance; please pass null as the lockFactory
>> instanc
>> e and use setLockFactory to change it: Directory was previously created
>> with a different LockFactory instance; please pass null as the
>> lockFactory ins
>> tance and use setLockFactory to change it
>>        at
>> org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:540)
>>        at
>> org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:213)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1790)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doPostInitialize(RepositoryImpl.java:2008)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1921)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:489)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:330)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:627)
>>        at
>> org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:141)
>>        at
>> org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:117)
>>        at
>> org.apache.jackrabbit.core.jndi.BindableRepository.<init>(BindableRepository.java:106)
>>        at
>> org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:51)
>>        at
>> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
>>        at
>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>        at
>> org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97)
>>        at
>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>        at
>> nl.rug.ucms.fs.jcr.JcrConfiguration.initialize(JcrConfiguration.java:44)
>>        ...
>> Caused by: java.io.IOException: Directory was previously created with a
>> different LockFactory instance; please pass null as the lockFactory
>> instance a
>> nd 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:229)
>>        at
>> org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:502)
>>        at
>> org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:66)
>>        at
>> org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:538)
>>        ... 46 more
>> java.io.IOException: Directory was previously created with a different
>> LockFactory instance; please pass null as the lockFactory instance and
>> use setL
>> ockFactory 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:229)
>>        at
>> org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:502)
>>        at
>> org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:66)
>>        at
>> org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:538)
>>        at
>> org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:213)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1790)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doPostInitialize(RepositoryImpl.java:2008)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1921)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:489)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:330)
>>        at
>> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:627)
>>        at
>> org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:141)
>>        at
>> org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:117)
>>        at
>> org.apache.jackrabbit.core.jndi.BindableRepository.<init>(BindableRepository.java:106)
>>        at
>> org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:51)
>>        at
>> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
>>        at
>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>        at
>> org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97)
>>        at
>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
>>        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>>        at
>> nl.rug.ucms.fs.jcr.JcrConfiguration.initialize(JcrConfiguration.java:44)
>>        ...
>>
>> --
>> Dennis van der Laan
>>
>>
>>     


Re: Unable to start second node in a cluster

Posted by Martijn Hendriks <mh...@gmail.com>.
The only thing I can think of is that Lucene left a lock file
somewhere but I have no clue why it should do that... It is strange
that this happens with the bundle PM and not with the regular DB PM.
You don't use a filsystem which is shared between the cluster nodes,
do you?

Martijn

On Wed, Dec 16, 2009 at 10:37 AM, Dennis van der Laan
<d....@rug.nl> wrote:
> Hi Martijn,
>> We often use a bundle db PM in a cluster and I've never seen the
>> problem you describe. It woul help if you can provide more detailed
>> logging, and which version of Jackrabbit are you using?
>>
>>
> See below for our configuration file and some more error logging. Note
> that the System property "ucms.cluster.id" is different for each cluster
> node, the rest of the used properties have the same values for all
> cluster nodes. As said, changing the bundle.OraclePersistenceManager to
> a db.OraclePersistenceManager fixes the problem, but is not what I want...
>
> Thanks,
> Dennis
>
> === repository.xml ===
>
> <?xml version="1.0"?>
> <!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD
> Jackrabbit 1.5//EN"
>
> "http://jackrabbit.apache.org/dtd/repository-1.5.dtd">
> <Repository>
>    <Cluster id="${ucms.cluster.id}">
>        <Journal
> class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">
>            <param name="revision" value="${rep.home}/revision.log" />
>            <param name="driver" value="oracle.jdbc.driver.OracleDriver" />
>            <param name="url" value="${ucms.cluster.db.url}" />
>            <param name="user" value="${ucms.cluster.db.user}"/>
>            <param name="password" value="${ucms.cluster.db.passwd}"/>
>        </Journal>
>    </Cluster>
>
>    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>        <param name="path" value="${rep.home}/repository"/>
>    </FileSystem>
>
>    <Security appName="Jackrabbit">
>        <SecurityManager
> class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
> workspaceName="security" />
>        <AccessManager
> class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager" />
>        <LoginModule
> class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
>           <param name="anonymousId" value="anonymous"/>
>           <param name="adminId" value="admin"/>
>        </LoginModule>
>    </Security>
>
>    <Workspaces rootPath="${rep.home}/workspaces"
> defaultWorkspace="default"/>
>
>    <Workspace name="${wsp.name}">
>        <FileSystem
> class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>            <param name="path" value="${wsp.home}"/>
>        </FileSystem>
>
>        <PersistenceManager
> class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
>            <param name="url" value="${ucms.cluster.db.url}"/>
>            <param name="user" value="${ucms.cluster.db.user}"/>
>            <param name="password" value="${ucms.cluster.db.passwd}"/>
>            <param name="schemaObjectPrefix" value="${wsp.name}_"/>
>            <param name="bundleCacheSize" value="8"/>
>        </PersistenceManager>
>
>        <SearchIndex
> class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>            <param name="path" value="${wsp.home}/index"/>
>            <param name="textFilterClasses"
> value="org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
>            <param name="extractorPoolSize" value="2"/>
>            <param name="supportHighlighting" value="true"/>
>        </SearchIndex>
>    </Workspace>
>
>    <Versioning rootPath="${rep.home}/version">
>        <FileSystem
> class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>            <param name="path" value="${rep.home}/version" />
>        </FileSystem>
>
>        <PersistenceManager
> class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
>            <param name="url" value="${ucms.cluster.db.url}"/>
>            <param name="user" value="${ucms.cluster.db.user}"/>
>            <param name="password" value="${ucms.cluster.db.passwd}"/>
>            <param name="schemaObjectPrefix" value="version_"/>
>            <param name="bundleCacheSize" value="8"/>
>        </PersistenceManager>
>    </Versioning>
>
>    <SearchIndex
> class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>        <param name="path" value="${rep.home}/repository/index"/>
>        <param name="textFilterClasses"
> value="org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
>        <param name="extractorPoolSize" value="2"/>
>        <param name="supportHighlighting" value="true"/>
>    </SearchIndex>
>
>    <!-- DataStore configuration -->
>    <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
>        <param name="driver" value="oracle.jdbc.OracleDriver"/>
>        <param name="url" value="${ucms.cluster.db.url}"/>
>        <param name="user" value="${ucms.cluster.db.user}"/>
>        <param name="password" value="${ucms.cluster.db.passwd}"/>
>        <param name="minRecordLength" value="1024"/>
>        <param name="maxConnections" value="8"/>
>        <param name="copyWhenReading" value="true"/>
>    </DataStore>
> </Repository>
>
> === error message ===
>
> 2009-12-15 22:50:33,948 ERROR
> [org.apache.jackrabbit.core.RepositoryImpl] - failed to start
> Repository: Directory was previously created with a differ
> ent LockFactory instance; please pass null as the lockFactory instance
> and use setLockFactory to change it: Directory was previously created
> with a di
> fferent LockFactory instance; please pass null as the lockFactory
> instance and use setLockFactory to change it
> javax.jcr.RepositoryException: Directory was previously created with a
> different LockFactory instance; please pass null as the lockFactory
> instance an
> d use setLockFactory to change it: Directory was previously created with
> a different LockFactory instance; please pass null as the lockFactory
> instanc
> e and use setLockFactory to change it: Directory was previously created
> with a different LockFactory instance; please pass null as the
> lockFactory ins
> tance and use setLockFactory to change it
>        at
> org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:540)
>        at
> org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:213)
>        at
> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1790)
>        at
> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doPostInitialize(RepositoryImpl.java:2008)
>        at
> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1921)
>        at
> org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:489)
>        at
> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:330)
>        at
> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:627)
>        at
> org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:141)
>        at
> org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:117)
>        at
> org.apache.jackrabbit.core.jndi.BindableRepository.<init>(BindableRepository.java:106)
>        at
> org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:51)
>        at
> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
>        at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>        at
> org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97)
>        at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>        at
> nl.rug.ucms.fs.jcr.JcrConfiguration.initialize(JcrConfiguration.java:44)
>        ...
> Caused by: java.io.IOException: Directory was previously created with a
> different LockFactory instance; please pass null as the lockFactory
> instance a
> nd 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:229)
>        at
> org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:502)
>        at
> org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:66)
>        at
> org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:538)
>        ... 46 more
> java.io.IOException: Directory was previously created with a different
> LockFactory instance; please pass null as the lockFactory instance and
> use setL
> ockFactory 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:229)
>        at
> org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:502)
>        at
> org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:66)
>        at
> org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:538)
>        at
> org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:213)
>        at
> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1790)
>        at
> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doPostInitialize(RepositoryImpl.java:2008)
>        at
> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1921)
>        at
> org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:489)
>        at
> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:330)
>        at
> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:627)
>        at
> org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:141)
>        at
> org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:117)
>        at
> org.apache.jackrabbit.core.jndi.BindableRepository.<init>(BindableRepository.java:106)
>        at
> org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:51)
>        at
> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
>        at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>        at
> org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97)
>        at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
>        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
>        at
> nl.rug.ucms.fs.jcr.JcrConfiguration.initialize(JcrConfiguration.java:44)
>        ...
>
> --
> Dennis van der Laan
>
>

Re: Unable to start second node in a cluster

Posted by Dennis van der Laan <d....@rug.nl>.
Hi Martijn,
> We often use a bundle db PM in a cluster and I've never seen the
> problem you describe. It woul help if you can provide more detailed
> logging, and which version of Jackrabbit are you using?
>
>   
See below for our configuration file and some more error logging. Note
that the System property "ucms.cluster.id" is different for each cluster
node, the rest of the used properties have the same values for all
cluster nodes. As said, changing the bundle.OraclePersistenceManager to
a db.OraclePersistenceManager fixes the problem, but is not what I want...

Thanks,
Dennis

=== repository.xml ===

<?xml version="1.0"?>
<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD
Jackrabbit 1.5//EN"
                           
"http://jackrabbit.apache.org/dtd/repository-1.5.dtd">
<Repository>
    <Cluster id="${ucms.cluster.id}">
        <Journal
class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">
            <param name="revision" value="${rep.home}/revision.log" />
            <param name="driver" value="oracle.jdbc.driver.OracleDriver" />
            <param name="url" value="${ucms.cluster.db.url}" />
            <param name="user" value="${ucms.cluster.db.user}"/>
            <param name="password" value="${ucms.cluster.db.passwd}"/>
        </Journal>
    </Cluster>

    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${rep.home}/repository"/>
    </FileSystem>

    <Security appName="Jackrabbit">
        <SecurityManager
class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
workspaceName="security" />
        <AccessManager
class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager" />
        <LoginModule
class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
           <param name="anonymousId" value="anonymous"/>
           <param name="adminId" value="admin"/>
        </LoginModule>
    </Security>

    <Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>

    <Workspace name="${wsp.name}">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>

        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
            <param name="url" value="${ucms.cluster.db.url}"/>
            <param name="user" value="${ucms.cluster.db.user}"/>
            <param name="password" value="${ucms.cluster.db.passwd}"/>
            <param name="schemaObjectPrefix" value="${wsp.name}_"/>
            <param name="bundleCacheSize" value="8"/>
        </PersistenceManager>

        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="textFilterClasses"
value="org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
            <param name="extractorPoolSize" value="2"/>
            <param name="supportHighlighting" value="true"/>
        </SearchIndex>
    </Workspace>

    <Versioning rootPath="${rep.home}/version">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version" />
        </FileSystem>

        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
            <param name="url" value="${ucms.cluster.db.url}"/>
            <param name="user" value="${ucms.cluster.db.user}"/>
            <param name="password" value="${ucms.cluster.db.passwd}"/>
            <param name="schemaObjectPrefix" value="version_"/>
            <param name="bundleCacheSize" value="8"/>
        </PersistenceManager>
    </Versioning>

    <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="${rep.home}/repository/index"/>
        <param name="textFilterClasses"
value="org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
        <param name="extractorPoolSize" value="2"/>
        <param name="supportHighlighting" value="true"/>
    </SearchIndex>

    <!-- DataStore configuration -->
    <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
        <param name="driver" value="oracle.jdbc.OracleDriver"/>
        <param name="url" value="${ucms.cluster.db.url}"/>
        <param name="user" value="${ucms.cluster.db.user}"/>
        <param name="password" value="${ucms.cluster.db.passwd}"/>
        <param name="minRecordLength" value="1024"/>
        <param name="maxConnections" value="8"/>
        <param name="copyWhenReading" value="true"/>
    </DataStore>
</Repository>

=== error message ===

2009-12-15 22:50:33,948 ERROR
[org.apache.jackrabbit.core.RepositoryImpl] - failed to start
Repository: Directory was previously created with a differ
ent LockFactory instance; please pass null as the lockFactory instance
and use setLockFactory to change it: Directory was previously created
with a di
fferent LockFactory instance; please pass null as the lockFactory
instance and use setLockFactory to change it
javax.jcr.RepositoryException: Directory was previously created with a
different LockFactory instance; please pass null as the lockFactory
instance an
d use setLockFactory to change it: Directory was previously created with
a different LockFactory instance; please pass null as the lockFactory
instanc
e and use setLockFactory to change it: Directory was previously created
with a different LockFactory instance; please pass null as the
lockFactory ins
tance and use setLockFactory to change it
        at
org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:540)
        at
org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:213)
        at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1790)
        at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doPostInitialize(RepositoryImpl.java:2008)
        at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1921)
        at
org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:489)
        at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:330)
        at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:627)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:141)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:117)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.<init>(BindableRepository.java:106)
        at
org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:51)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
nl.rug.ucms.fs.jcr.JcrConfiguration.initialize(JcrConfiguration.java:44)
        ...
Caused by: java.io.IOException: Directory was previously created with a
different LockFactory instance; please pass null as the lockFactory
instance a
nd 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:229)
        at
org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:502)
        at
org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:66)
        at
org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:538)
        ... 46 more
java.io.IOException: Directory was previously created with a different
LockFactory instance; please pass null as the lockFactory instance and
use setL
ockFactory 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:229)
        at
org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:502)
        at
org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:66)
        at
org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:538)
        at
org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:213)
        at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1790)
        at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doPostInitialize(RepositoryImpl.java:2008)
        at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1921)
        at
org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:489)
        at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:330)
        at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:627)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:141)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:117)
        at
org.apache.jackrabbit.core.jndi.BindableRepository.<init>(BindableRepository.java:106)
        at
org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:51)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at
nl.rug.ucms.fs.jcr.JcrConfiguration.initialize(JcrConfiguration.java:44)
        ...

-- 
Dennis van der Laan


Re: Unable to start second node in a cluster

Posted by Martijn Hendriks <mh...@gmail.com>.
Hi Dennis,

We often use a bundle db PM in a cluster and I've never seen the
problem you describe. It woul help if you can provide more detailed
logging, and which version of Jackrabbit are you using?

Best regards,
Martijn

On Wed, Dec 16, 2009 at 12:18 AM, Dennis van der Laan
<d....@rug.nl> wrote:
> Dennis van der Laan wrote:
>> Hi,
>>
>> I have two identical machines (A and B) running Jackrabbit 1.6.0 on
>> Tomcat 6.0. I made an empty folder on each machine, containing only a
>> repository.xml file, again both identical (using System properties to
>> set the cluster ID). The repository configuration uses a bundle PM
>> (Oracle 10g database) and a local filesystem for all components.
>>
>> When I start A, the repository tables are created in the database and
>> all works well. After the repository is initialized, I add some custom
>> namespaces and nodetypes, and create a basic folder hierarchy.
>> Then, when I start B, I get the following exception:
>>
>> 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)
>>
>> When I stop both A and B, and starting them again, A can startup again
>> but B still gives the exception.
>>
>> I removed all tables from the database and re-created the repository
>> folders on both machines and inverted the startup: first I started B and
>> then I started A. Now B starts up fine, but A gives the exception.
>>
>> In the LOCAL_REVISIONS table I can see both cluster instances add their
>> revision (revision 12 for the started repository and 0 for the failed
>> repository).
>>
>> What am I doing wrong here? I found an issue involving LockFactory
>> exceptions, but they all had to do with starting and stopping multiple
>> repositories in the same VM or concurrently on the same machine.
>>
> I changed the repository configuration from using a bundle database PM
> to a simple database PM (from
> org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager
> to org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager).
> Now it works! But a bundle PM should have better performance. Is this a
> bug? Is anybody else using a bundle database PM in a cluster configuration?
>
> Thanks,
> Dennis
>
> --
> Dennis van der Laan
>
>

Re: Unable to start second node in a cluster

Posted by Dennis van der Laan <d....@rug.nl>.
Dennis van der Laan wrote:
> Hi,
>
> I have two identical machines (A and B) running Jackrabbit 1.6.0 on
> Tomcat 6.0. I made an empty folder on each machine, containing only a
> repository.xml file, again both identical (using System properties to
> set the cluster ID). The repository configuration uses a bundle PM
> (Oracle 10g database) and a local filesystem for all components.
>
> When I start A, the repository tables are created in the database and
> all works well. After the repository is initialized, I add some custom
> namespaces and nodetypes, and create a basic folder hierarchy.
> Then, when I start B, I get the following exception:
>
> 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)
>
> When I stop both A and B, and starting them again, A can startup again
> but B still gives the exception.
>
> I removed all tables from the database and re-created the repository
> folders on both machines and inverted the startup: first I started B and
> then I started A. Now B starts up fine, but A gives the exception.
>
> In the LOCAL_REVISIONS table I can see both cluster instances add their
> revision (revision 12 for the started repository and 0 for the failed
> repository).
>
> What am I doing wrong here? I found an issue involving LockFactory
> exceptions, but they all had to do with starting and stopping multiple
> repositories in the same VM or concurrently on the same machine.
>   
I changed the repository configuration from using a bundle database PM
to a simple database PM (from
org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager
to org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager).
Now it works! But a bundle PM should have better performance. Is this a
bug? Is anybody else using a bundle database PM in a cluster configuration?

Thanks,
Dennis

-- 
Dennis van der Laan