Hope this is the right forum to post this question.
I have created a search application using Lucene, which works very well as a standalone application. However, when i try to call the search application from a servlet, i am getting the below exception. I am not very clear on the exception and hence i am not able to think of a remedy beyond certain level. Therefore, if anybody encountered similar problem; could you please share your experience, expecially on the exception itself and on the resolution part of it. The application details are,
Searching starts... Index directory = org.apache.lucene.store.FSDirectory@D:\EclipseProjects\KnowledgeBase\docbase java.io.IOException: Unknown format version: -4 at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:195) at org.apache.lucene.index.IndexReader$1.doBody(IndexReader.java:152) at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:579) at org.apache.lucene.index.IndexReader.open(IndexReader.java:147) at org.apache.lucene.index.IndexReader.open(IndexReader.java:142) at org.apache.lucene.search.IndexSearcher.<init>(IndexSearcher.java:48) at com.kb.logic.IndexSearch.search(IndexSearch.java:31) at com.kb.servlet.SearchServlet.doPost(SearchServlet.java:62) at com.kb.servlet.SearchServlet.doGet(SearchServlet.java:36) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595)
Thanks a lot for your help.
Regards, ravi
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
Not sure if that's the problem, but make sure that the Lucene version used to create the index is the same that's being used to read it.