I'm new to OpenNLP, and am trying to use the Sentence Detector. I am stumped by
the following error:
Caused by: java.lang.VerifyError: (class: opennlp/model/GenericModelReader,
method: checkModelType signature: ()V) Bad type in putfield/putstatic
at
opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
at
opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
at opennlp.tools.sentdetect.SentenceModel.<init>(SentenceModel.java:77)
This occurs with the following code:
SentenceModel model = new SentenceModel(new FileInputStream(new
File("/Users/ryancornia/Downloads/en-sent.bin")));
sentenceDetector = new SentenceDetectorME(model);
Clearly it is not liking the model, but if I run it from the command line with
the same model file, it works fine. I AM running this inside Tomcat, and am
wondering if being in a servlet container could be causing an issue? Anyone
running inside an app server? Or any other ideas? It seems really odd it runs
from the command line with the same model.
-Ryan