I have a Java Eclipse plugin and I am having trouble some really simple
code.
I can do the following …
JLanguageTool langTool;
Language lang = Language.BRITISH_ENGLISH;
However I get a runtime error with the following…
JLanguageTool langTool = new JLanguageTool(Language.BRITISH_ENGLISH);
The following exception is thrown…
java.lang.NoClassDefFoundError: Could not initialize class
org.languagetool.tokenizers.SRXSentenceTokenizer
I unzipped your zip (from your homepage) to the root of my plugin and
added the jars and paths to the classpath.
Then I added the jar paths to the manifest.
I looked into the JLanguageTool.jar and I can see
org.languagetool.tokenizers.SRXSentenceTokenizer is in there.
I had originally unzipped your zip to my Eclipse plugins folder and
pointed the classpath there but had a runtime error with ‘JLanguageTool
langTool;’
So I unzipped it into the plugin root and at least was able to create an
instance of JLanguageTool after that.
Any ideas what is going wrong?
It looks like it could be a good tool for us,
So I would really like to resolve this.
Been messing around with it for a day now.
However I get a runtime error with the following…
JLanguageTool langTool = new JLanguageTool(Language.BRITISH_ENGLISH);
The following exception is thrown…
java.lang.NoClassDefFoundError: Could not initialize class
org.languagetool.tokenizers.SRXSentenceTokenizer
That’s indeed strange, as both of these are in the same JAR. Maybe Eclipse
got confused and it might help to re-build the project? Does the complete
stacktrace reveal more information? Does the same thing happen when you
have a very simple class with just a main() method?
Another approach might be to try Maven, so that you just need to add the
dependency information to your pom.xml (see http://www.languagetool.org/java-api/) and Maven will do the rest. I don’t
know about how the Maven/Eclipse integration though.
thanks for the reply.
I cleaned the project but unfortunately got the same result.
I noticed that the 1st time I run this I get the following …
java.lang.ExceptionInInitializerError
java.lang.UnsupportedOperationException: This parser does not support specification “null” version “null”
After that I get the NoClassDefFoundError exception each time …
java.lang.NoClassDefFoundError: Could not initialize class org.languagetool.tokenizers.SRXSentenceTokenizer
From looking at the JLanguageTool constructor it looks like it is able to get all the rules (and even the disambiguator and tagger) but falters on the Tokeniser class.
Caused by: java.lang.ExceptionInInitializerError
at org.languagetool.language.English.getSentenceTokenizer(English.java:68)
…
Caused by: java.lang.UnsupportedOperationException: This parser does not support specification “null” version “null”
at javax.xml.parsers.SAXParserFactory.setSchema(Unknown Source)
at net.sourceforge.segment.srx.io.Srx2SaxParser.(Srx2SaxParser.java:179)
at org.languagetool.tokenizers.SRXSentenceTokenizer.createSrxDocument(SRXSentenceTokenizer.java:60)
at org.languagetool.tokenizers.SRXSentenceTokenizer.(SRXSentenceTokenizer.java:47)
… 79 more
I made a simple Eclipse plugin and had the same problems.
I can zip this up and send it if that would be helpful.
Suspect it is an issue with class paths
I made a simple Eclipse plugin and had the same problems.
I can zip this up and send it if that would be helpful.
Suspect it is an issue with class paths