Hi everyone,

I'm relatively new to OpenNLP software.  For my project I am using the
Sentence detector feature of opennlp.  When I run the project on my local
tomcat server through eclipse, the sentence detector feature works great.
However, when I do a build (through ant) and put it on an internal test
server, I get the following exception(OpenNLPEvaluator.java is a class
which I wrote):

...
caused by:  Java.lang.NoClassDefFoundError:opennlpmodel/MaxentModel
... OpenNLPEvaluator.loadSentenceModel(OpenNLPEvaluator.java:223)

...
caused by: java.lang.ClassNotFoundException: opennlp.model.MaxentModel

The lines it fails at:

OpenNLPEvaluator.java

219 InputStream modelIn = null;
220 try {
221 salsa.getSystemLogger().info("Loading NLP sentence model...");
222 modelIn = new FileInputStream(sentenceModelPath);
223 SentenceModel sentenceModel = new SentenceModel(modelIn);
224 sentenceDetector = new SentenceDetectorME(sentenceModel);
225 }
226 catch (IOException ex) {
227 salsa.getSystemLogger().debug("OpenNLP sentence model failed to load");
228 ex.printStackTrace();
229 return false;
230 }
231 finally {
232 try {
233 modelIn.close();
234
235 }
236 catch (IOException ignored) { }
237 }

It fails at line 223, which is when I try to create a SentenceModel
object.  All three of the opennlp jars are in my class path, build path,
and build.xml file.  Can anyone point me in the right direction as to how
to fix this issue?

Reply via email to