java.lang.NoSuchMethodError

Hello

I am getting this exception:

Caused by: java.lang.NoSuchMethodError: org.apache.commons.lang.ObjectUtils.clone(Ljava/lang/Object;)Ljava/lang/Object;

After upgrading to version 3.5. There is a clone method on org.apache.commons.lang3.ObjectUtils.

Cheers

Could you post the complete stack trace? When exactly does this happen?

Sorry, checking on my dependencies it was using commons-lang-2.4.jar and I think your classes uses commons-lang-2.6.jar. Everyone has now upgraded to lang3 but language tool plus one other are still using the old lan2. Is it possible to switch to lang3 here as version 2 is end of life now.

I’ve just done that (here). As one of our (unmaintained, it seems) dependencies is still on commons-lang 2.6, that still needs to be in the classpath, though.

OK great, checking on my dependencies it is only on the langualetool-core, possibly I exclude the jar that uses the 2.6 version? Which jar uses 2.6?

Actually lang-zh is still on 2.4, languagetool-dev (which shouldn’t be relevant at runtime) is still at 2.6.

If its -zh, as I only use -en it should be gone. :smile:

org.languagetool
language-en

I do get a polish jar from morfologik-speller ??

morfologik-polish-2.0.0.jar

Cheers

I cannot reproduce that, could you check (and maybe post) the complete output of mvn dependency:report?

[INFO] +- org.languagetool:language-en:jar:3.5:compile
[INFO] |  +- org.languagetool:languagetool-core:jar:3.5:compile
[INFO] |  |  +- commons-lang:commons-lang:jar:2.6:compile
[INFO] |  |  +- net.java.dev.jna:jna:jar:4.1.0:compile
[INFO] |  |  +- org.carrot2:morfologik-fsa:jar:2.1.0:compile
[INFO] |  |  +- org.carrot2:morfologik-fsa-builders:jar:2.1.0:compile
[INFO] |  |  +- org.carrot2:morfologik-speller:jar:2.1.0:compile
[INFO] |  |  |  \- org.carrot2:morfologik-polish:jar:2.0.0:compile
[INFO] |  |  +- org.carrot2:morfologik-stemming:jar:2.1.0:compile
[INFO] |  |  +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] |  |  +- net.loomchild:segment:jar:2.0.0:compile
[INFO] |  |  +- com.optimaize.languagedetector:language-detector:jar:0.5:compile
[INFO] |  |  |  \- net.arnx:jsonic:jar:1.2.11:compile
[INFO] |  |  +- com.intellij:annotations:jar:12.0:compile
[INFO] |  |  \- edu.berkeley.nlp:berkeleylm:jar:1.1.2:compile
[INFO] |  +- org.apache.opennlp:opennlp-tools:jar:1.6.0:compile
[INFO] |  +- edu.washington.cs.knowitall:opennlp-tokenize-models:jar:1.5:compile
[INFO] |  +- edu.washington.cs.knowitall:opennlp-postag-models:jar:1.5:compile
[INFO] |  \- edu.washington.cs.knowitall:opennlp-chunk-models:jar:1.5:compile

Maybe there was a bug in Morfologik 2.1.0 (used by LT 3.5), but it should be fixed in git, as I cannot reproduce this. We’re using Morfologik 2.1.2 now.

I just specify 3.5 and Morfologik is only used for me by language tool so not sure why I only get 2.1.0.

If I only want to spell check do you know what jars I actually need?

No sorry, you’ll have to try.