Hello,

I was trying to run the OpenNLP UIMA wrapper "OpenNLPAggregate.xml" from the UIMA examples (org.apache.uima.examples.opennlp.annotators) and load it in the CAS Visual Debugger. I got the following Java exception:

"Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java: 280)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: 374) at org .apache .uima .examples .opennlp.annotator.SentenceDetector.initialize(SentenceDetector.java:54)
        ...
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java: 110)

"
The Java source code of this line is when the Wrapper initializes the OpenNLP Sentence Detector:

sentenceDetector = new opennlp.tools.lang.english.SentenceDetector(modelFile);


I did the following steps.

  1) Create a new Java project with UIMA nature.
2) Add necessary libraries (uima core, opennlp, etc.) and descriptors (Aggregate Engine and it's dependent Annotators) 3) set the "ModeFile" parameter "Configuration Parameters" in the Analysis Engine XML files (OpenNLPSentenceDetec, OpenNLPTokenizer, OpenNLPTagger) to the absolute path of the corresponding model file (e.g. /home/workspace/models/model.bin.gz). I also tried relative paths.
  4) Open the CAS Visual Debugger and Load the Aggregate Engine
5) Java Error when trying to load the model file: UnsupportedClassVersionError Error

Maybe the model file was be loaded successfully. I do get the same error message when the model file in SentenceDetector is empty.

For any help I would be grateful.

Regards,
Toby

Reply via email to