ContentMine / ami

Apache License 2.0
13 stars 14 forks source link

Dictionary based search fails if not in code dir #32

Open tarrow opened 8 years ago

tarrow commented 8 years ago
tom@pisces newstack % ami-plugin/target/appassembler/bin/ami2-species --project ./zika -i scholarly.html --sp.species --context 35 --sp.type binomial genus 
java.lang.RuntimeException: invoke runExtractSpecies fails
        at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:873)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runMethodsOfType(DefaultArgProcessor.java:768)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runRunMethodsOnChosenArgOptions(DefaultArgProcessor.java:749)
        at org.xmlcml.ami2.plugins.AMIArgProcessor.runRunMethodsOnChosenArgOptions(AMIArgProcessor.java:176)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runAndOutput(DefaultArgProcessor.java:929)
        at org.xmlcml.ami2.plugins.species.SpeciesPlugin.main(SpeciesPlugin.java:36)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:871)
        ... 5 more
Caused by: java.lang.NullPointerException
        at org.xmlcml.ami2.dictionary.DefaultAMIDictionary.contains(DefaultAMIDictionary.java:112)
        at org.xmlcml.ami2.plugins.AMISearcher.markFalsePositives(AMISearcher.java:380)
        at org.xmlcml.ami2.plugins.AMISearcher.search(AMISearcher.java:284)
        at org.xmlcml.ami2.plugins.AMIArgProcessor.searchSectionElements(AMIArgProcessor.java:298)
        at org.xmlcml.ami2.plugins.species.SpeciesArgProcessor.runExtractSpecies(SpeciesArgProcessor.java:57)
        ... 10 more
java.lang.RuntimeException: invoke runExtractSpecies fails
        at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:873)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runMethodsOfType(DefaultArgProcessor.java:768)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runRunMethodsOnChosenArgOptions(DefaultArgProcessor.java:749)
        at org.xmlcml.ami2.plugins.AMIArgProcessor.runRunMethodsOnChosenArgOptions(AMIArgProcessor.java:176)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runAndOutput(DefaultArgProcessor.java:929)
        at org.xmlcml.ami2.plugins.species.SpeciesPlugin.main(SpeciesPlugin.java:36)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:871)
        ... 5 more
Caused by: java.lang.NullPointerException
        at org.xmlcml.ami2.dictionary.DefaultAMIDictionary.contains(DefaultAMIDictionary.java:112)
        at org.xmlcml.ami2.plugins.AMISearcher.markFalsePositives(AMISearcher.java:380)
        at org.xmlcml.ami2.plugins.AMISearcher.search(AMISearcher.java:284)
        at org.xmlcml.ami2.plugins.AMIArgProcessor.searchSectionElements(AMIArgProcessor.java:298)
        at org.xmlcml.ami2.plugins.species.SpeciesArgProcessor.runExtractSpecies(SpeciesArgProcessor.java:57)
        ... 10 more
java.lang.RuntimeException: invoke runExtractSpecies fails
        at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:873)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runMethodsOfType(DefaultArgProcessor.java:768)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runRunMethodsOnChosenArgOptions(DefaultArgProcessor.java:749)
        at org.xmlcml.ami2.plugins.AMIArgProcessor.runRunMethodsOnChosenArgOptions(AMIArgProcessor.java:176)
        at org.xmlcml.cmine.args.DefaultArgProcessor.runAndOutput(DefaultArgProcessor.java:929)
        at org.xmlcml.ami2.plugins.species.SpeciesPlugin.main(SpeciesPlugin.java:36)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:871)
        ... 5 more
Caused by: java.lang.NullPointerException
        at org.xmlcml.ami2.dictionary.DefaultAMIDictionary.contains(DefaultAMIDictionary.java:112)
        at org.xmlcml.ami2.plugins.AMISearcher.markFalsePositives(AMISearcher.java:380)
        at org.xmlcml.ami2.plugins.AMISearcher.search(AMISearcher.java:284)
        at org.xmlcml.ami2.plugins.AMIArgProcessor.searchSectionElements(AMIArgProcessor.java:298)
        at org.xmlcml.ami2.plugins.species.SpeciesArgProcessor.runExtractSpecies(SpeciesArgProcessor.java:57)
        ... 10 more

This doesn't happen if in ami-plugin. I assume there is some hardcoded path to the/a dictionary somewhere.