• connoryz

    connoryz - 2006-10-20

    hi benjellr,

      I got the following errors when I run my program:

    Exception in thread "main" H:\Files\AIMS\Code\OSSE\Index_Server\_1.fnm (The system cannot find the file specified)
        at Method)
        at<init>(Unknown Source)
        at org.apache.lucene.index.FieldInfos.<init>(
        at org.apache.lucene.index.SegmentReader.initialize(
        at org.apache.lucene.index.SegmentReader.get(
        at org.apache.lucene.index.SegmentReader.get(
        at org.apache.lucene.index.IndexWriter.mergeSegments(
        at org.apache.lucene.index.IndexWriter.mergeSegments(
        at org.apache.lucene.index.IndexWriter.optimize(
        at IndexAll.IndexFile(
        at IndexAll.main(

    Do you know where the problem is?

    Follow is a segment of my program:

    private static void index(IndexWriter writer, LiusConfig lc, File f, File indexDir) throws IOException, LiusException{   
                MixedIndexer indexer = new MixedIndexer();
                System.out.println("Indexing " + f.getPath());
                List <Field> fields = new ArrayList<Field>();
                fields.add(new Field("filename", f.getName(), Field.Store.YES, Field.Index.TOKENIZED));//edit the contents of a document
                fields.add(new Field("filepath", f.getCanonicalPath(), Field.Store.YES, Field.Index.TOKENIZED));//get the file name and add it to a docuement
                indexer.index(indexDir.getCanonicalPath(), fields);
                Document luceneDoc = LuceneActions.getSingletonInstance().populateLuceneDoc(indexer.getPopulatedLiusFields());
                LuceneActions.getSingletonInstance().save(luceneDoc, writer, lc);

    Many thanks in advance!

    • Rida Benjelloun

      Rida Benjelloun - 2006-10-20

      You have to remove this 2 lines from your code :

      Document luceneDoc = LuceneActions.getSingletonInstance().populateLuceneDoc(indexer.getPopulatedLiusFields());

      LuceneActions.getSingletonInstance().save(luceneDoc, writer, lc);

      • connoryz

        connoryz - 2006-10-20


        i understand it now. thanks a lot!

    • connoryz

      connoryz - 2006-10-20

      thanks benjellr,

        firstly, i tried to follow your instructions to remove these two lines. but the programs gives me the same error as well.

        secondly, could i ask if i remove these two lines. how the indexed fields stored in a document? i mean, where is the connect between the writer and indexer? i think we should use the line:

      LuceneActions.getSingletonInstance().save(luceneDoc, writer, lc);

      to create a Lucene document. isnt it?

      just very confused about these two sentences. could you explain it to me? many many thanks in advance!

    • Ekaterina Volkova

      Hi, benjellr,

      I have a similar problem - i just try to run a code from the tutorial, and get the same mistake.

      Here is the code:


      import lius.LiusLogger;
      import lius.config.LiusConfig;
      import lius.config.LiusConfigBuilder;
      import lius.index.Indexer;
      import lius.index.IndexerFactory;

      public class LuisTest {

          public static void main(String[] args) {

              String indexDir = "path/index" ;
              String log4j = "path/";
              String toIndex = "path/test.pdf";
              String liusConfig = "path/liusConfig.xml";
              LiusConfig lc = LiusConfigBuilder.getSingletonInstance().getLiusConfig(liusConfig);
              Indexer indexer = IndexerFactory.getIndexer(new File(toIndex), lc);
              String text = indexer.getContent();


      the mistake I get is

      Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
          at lius.LiusLogger.<clinit>(
          at LuisTest.main(

      I use eclipse, so I guess i can be sure the classpath and all are configured properly.
      I'm quite new to Java and to Lucene too, could you please help me to figure out what I'm doing wrong?

      Thanks in advance!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks