• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Search using Lucene: Unknown format version: -4

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

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,

Tomcat server 5.5.26
Java 1.5.15
Lucene 2.3.1

Here is the exception.

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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,

Thanks a lot, you suggestion works. There was old version of lucene jar file in my tomcat directory. I removed the old version, it works now.

thanks again.

thanks and regards,
ravi.
 
Evildoers! Eat my justice! And this tiny ad's justice too!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic