I've setup my application to use a slave FS directory and when I'm starting the webapp I'm getting this:
Code:
Caused by: org.hibernate.HibernateException: Unable to initialize: xxxxx
at org.hibernate.search.store.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:147)
at org.hibernate.search.store.DirectoryProviderFactory.createDirectoryProviders(DirectoryProviderFactory.java:75)
at org.hibernate.search.impl.SearchFactoryImpl.initDocumentBuilders(SearchFactoryImpl.java:260)
at org.hibernate.search.impl.SearchFactoryImpl.<init>(SearchFactoryImpl.java:94)
at org.hibernate.search.impl.SearchFactoryImpl.getSearchFactory(SearchFactoryImpl.java:172)
at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:42)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:417)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1310)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:816)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:734)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1333)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1299)
... 103 more
Caused by: java.lang.IllegalStateException: No current marker in source directory
at org.hibernate.search.store.FSSlaveDirectoryProvider.initialize(FSSlaveDirectoryProvider.java:56)
at org.hibernate.search.store.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:144)
For the master side, I've done a simple web app which include the Hibernate MDB and the slave hibernate entities.
The master indexes are not created on startup.
-- slave hibernate config with spring:
Code:
<entry key="hibernate.search.default.indexBase" value="/var/lucene/indexes_slave_local" />
<entry key="hibernate.search.default.sourceBase" value="/var/lucene/indexes_master" />
<entry key="hibernate.search.default.refresh" value="300" />
<entry key="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSSlaveDirectoryProvider" />
<entry key="hibernate.search.worker.backend" value="jms" />
<entry key="hibernate.search.worker.jms.connection_factory" value="jms.sms.connectionFactory" />
<entry key="hibernate.search.worker.jms.queue" value="jms.sms.indexingQ" />
-- master hibernate config with spring:
Code:
<entry key="hibernate.search.worker.execution" value="async" />
<entry key="hibernate.search.worker.thread_pool.size" value="5" />
<entry key="hibernate.search.worker.buffer_queue.max" value="50" />
<entry key="hibernate.search.default.indexBase" value="/var/lucene/indexes_master_local" />
<entry key="hibernate.search.default.sourceBase" value="/var/lucene/indexes_master" />
<entry key="hibernate.search.default.refresh" value="300" />
<entry key="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSMasterDirectoryProvider" />
Another thing in term of architecture, I'm not sure the shared directory for the index replication is good thing. The JMS provides a decouple system for indexing which what we are looking for. But the shared directory provides a single point of failure and another connection glue via NFS/SMB/RCP/whatever!