0

I have a web java/jsp application running on Apache Tomcat server. In this web application I have used Lucene, to index and calculate similarity between some PDF documents(PDF documents are in the database). My live server (Tomcat based WSO2 stratos server) does not allow web-app to access files, so I have created the in-memory lucene index using RAMDirectory class.

In the current way that I have coded in my application, when for each time user access the Lucene involved functionality, it creates a new in-memory index.

Is there any way to create the in-memory index at the webapp deployment time, so that in-memory index will be created only once and I can access in-memory index as long as web app is live?

Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51
Kasun
  • 236
  • 1
  • 4
  • 14

1 Answers1

1

Essentially you seem to need a mechanism for executing code on application deployment. See tomcat auto start servlet.

Community
  • 1
  • 1
f_puras
  • 2,521
  • 4
  • 33
  • 38