ADAH-EviDENce / NewsReader

Docker build of full NewsReader pipeline in Dutch.
Apache License 2.0
2 stars 4 forks source link

ixa-heideltime cannot initialize JCas factory #17

Closed wmkouw closed 6 years ago

wmkouw commented 6 years ago

Goal: run ixa-heideltime on a part-of-speech tagged file.

Input: Called compiled jar on alpino-to-treetagger and with default config.props according to instructions

cat in.naf | java -jar target/ixa.pipe.time.jar -m lib/alpino-to-treetagger.csv -c heideltime-standalone-2.2.1/config.props > out.naf

Problem: JCas factory could not be initialized and Cas object could not be generated.

Stack trace:

Mar 28, 2018 2:37:30 PM ixa.pipe.time.IXAPipeHeidelTime initialize
INFO: HeidelTime initialized
java.lang.NullPointerException
    at org.apache.uima.util.XMLInputSource.<init>(XMLInputSource.java:118)
    at ixa.pipe.time.IXAPipeHeidelTime.initialize(IXAPipeHeidelTime.java:184)
    at ixa.pipe.time.IXAPipeHeidelTime.<init>(IXAPipeHeidelTime.java:135)
    at ixa.pipe.time.CLI.main(CLI.java:75)
Mar 28, 2018 2:37:30 PM ixa.pipe.time.IXAPipeHeidelTime initialize
WARNING: JCas factory could not be initialized
Mar 28, 2018 2:37:30 PM ixa.pipe.time.IXAPipeHeidelTime process
INFO: Processing started
java.lang.NullPointerException
    at ixa.pipe.time.IXAPipeHeidelTime.process(IXAPipeHeidelTime.java:300)
    at ixa.pipe.time.CLI.main(CLI.java:76)
Mar 28, 2018 2:37:30 PM ixa.pipe.time.IXAPipeHeidelTime process
WARNING: Cas object could not be generated
java.lang.NullPointerException
    at org.apache.uima.jcas.cas.TOP.<init>(TOP.java:95)
    at org.apache.uima.jcas.cas.AnnotationBase.<init>(AnnotationBase.java:66)
    at org.apache.uima.jcas.tcas.Annotation.<init>(Annotation.java:54)
    at de.unihd.dbs.uima.types.heideltime.Dct.<init>(Dct.java:42)
    at ixa.pipe.time.IXAPipeHeidelTime.provideDocumentCreationTime(IXAPipeHeidelTime.java:249)
    at ixa.pipe.time.IXAPipeHeidelTime.process(IXAPipeHeidelTime.java:313)
    at ixa.pipe.time.CLI.main(CLI.java:76)
Mar 28, 2018 2:37:30 PM ixa.pipe.time.IXAPipeHeidelTime process
WARNING: Processing aborted due to errors
IXAPipe-HeidelTime failed: 
java.lang.NullPointerException
    at ixa.pipe.time.IXAPipeHeidelTime.runIntervalTagger(IXAPipeHeidelTime.java:200)
    at ixa.pipe.time.IXAPipeHeidelTime.process(IXAPipeHeidelTime.java:327)
    at ixa.pipe.time.CLI.main(CLI.java:76)
wmkouw commented 6 years ago

jCas factory in IXAPipeHeidelTime.java is initialized using descriptions, which are taken from config.props:

TypeSystemDescription[] descriptions = new TypeSystemDescription[] {
    UIMAFramework
        .getXMLParser()
            .parseTypeSystemDescription(
                new XMLInputSource(
                    this.getClass()
                        .getClassLoader()
                            .getResource(
                                Config.get(Config.TYPESYSTEMHOME)))),
    UIMAFramework
        .getXMLParser()
            .parseTypeSystemDescription(
                new XMLInputSource(
                    this.getClass()
                        .getClassLoader()
                            .getResource(
                                Config.get(Config.TYPESYSTEMHOME_DKPRO)))) 
};

config.props points TYPESYSTEMHOME_DKPRO to desc/type/DKPro_TypeSystem.xml.

Heideltime does not contain DKPro_TypeSystem.xml.

Commenting out the second description (i.e. UIMAFramework until Config.get(Config.TYPESYSTEMHOME_DKPRO)))) in line 178 to 185 in IXAPipeHeidelTime.java) leads to no initialization errors.

Not closing, because I'm not sure if everything still works.

wmkouw commented 6 years ago

The initial compilation error that caused this issue has been resolved, see #16