Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problems with Tutorial 1

Help
dayrinni
2007-03-10
2013-04-17
  • dayrinni
    dayrinni
    2007-03-10

    I am trying to do tutorial 1 but having major problems. I am using 1.0-rc2.

    This is my test class:

    public static void main ( String[] args )
        {

            String indexDir = "C:\\James' Stuff\\Programs\\eclipse\\workspace\\Searching\\Sources";

            String toIndex = "openoffice.ods";

            String liusConfig = "liusConfig.xml";

            File file = new File(toIndex);

            System.out.println("File name: " + file.getAbsolutePath());

            LiusConfig lc = LiusConfigBuilder.getSingletonInstance().getLiusConfig(
                    liusConfig);

            Indexer indexer = IndexerFactory.getIndexer(file, lc);

            

            indexer.index(indexDir);

            

        }
    The openoffice.ods and LiusConfig.xml is in the project directory. I know it is able to get to these files as I have tested it.

    When I run the above code, I get this:

    File name: C:\James' Stuff\Programs\eclipse\workspace\Searching\openoffice.ods
    1173489702984 INFO [class de.sty.io.mimetype.MimeTypeResolver] Read serialized mimetype definitions: 405 known mimetypes, 2140 bytes to read for the longest match, 9 literal globs, 428 end globs, 2 start globs, 4 shell globs.
    Exception in thread "main" java.lang.NullPointerException
        at lius.index.IndexerFactory.getIndexer(IndexerFactory.java:54)
        at drivers.LIUSDriver.main(LIUSDriver.java:55)

    After doing some debugging, it is finding some problems with the mimetype stuff.

    What am I doing wrong?

    Thank you.