问题
By Hibernate search we create a search engine in my application. Here same application running in two different JBoss and using two different folder for storing index data. Two folder and Two JBoss running in different system. But some time showing bellow type of error. Please, give me any resolution.
16:45:58,184 ERROR [org.hibernate.search.exception.impl.LogErrorHandler] (Hibernate Search: Index updates queue processor for index in.issac.wisebank.systemadmin.customermanagement.entiry.WbSaCustomermaster-1) HSEARCH000058: Exception occurred org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/Folder_Path/write.lock Primary Failure: Entity in.issac.wisebank.systemadmin.customermanagement.entiry.WbSaCustomermaster Id 49621 Work Type org.hibernate.search.backend.UpdateLuceneWork : org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/home/ccblcbs/wisebankenterprise/globalsearch/index12/in.issac.wisebank.systemadmin.customermanagement.entiry.WbSaCustomermaster/write.lock at org.apache.lucene.store.Lock.obtain(Lock.java:84) [lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40] at org.apache.lucene.index.IndexWriter.(IndexWriter.java:1098) [lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40] at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:146) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:113) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:101) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_24] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_24] at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_24] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_24] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_24] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_24] 16:45:58,187 ERROR [org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask] (Hibernate Search: Index updates queue processor for index in.issac.wisebank.systemadmin.customermanagement.entiry.WbSaCustomermaster-1) HSEARCH000072: Couldn't open the IndexWriter because of previous error: operation skipped, index ouf of sync!
回答1:
It's caused by Windows, you should read about LOCKING STRATEGY.
https://docs.jboss.org/hibernate/search/3.2/reference/en/html_single/#search-configuration-directory-lockfactories
回答2:
This version of Hibernate Search is extremely old; this issue could occasionally happen but was resolved. You need to update.
来源:https://stackoverflow.com/questions/45012593/error-in-write-lock-in-hibernate-search