我正在使用 Elasticsearch Jest 客户端来编写我自己的客户端应用程序。
我不断收到这个
java.lang.ClassNotFoundException:org.apache.commons.lang3.StringUtils
即使我已经在构建过程中包含了所有 JAR。
所采取的行动:
- 禁用 maven 并手动添加所有 JARS
- 在 3.3.2 之上添加了 apache-common-lang-2.6
- 清理/重启日食
什么都没有:(
有错误的截图:
错误信息:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/lang3/StringUtils
at io.searchbox.action.AbstractAction.buildURI(AbstractAction.java:171)
at io.searchbox.action.AbstractDocumentTargetedAction.buildURI(AbstractDocumentTarg etedAction.java:40)
at io.searchbox.core.Index.<init>(Index.java:23)
at io.searchbox.core.Index.<init>(Index.java:15)
at io.searchbox.core.Index$Builder.build(Index.java:63)
at
Kinnetics.KinneticsElasticsearchClient.indexParameter(KinneticsElasticsearchClient.java:54)
at Kinnetics.ManagementWrapper.main(PredictoModule.java:74)
at Kinnetics.PredictoModule.main(PredictoModule.java:28)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more
verbose:class output:
Line 6: C:\Users\Eitan\workspace\SelfAnomalyDetector - ver7\JARs For Jest\commons-lang-2.6.jar;
Line 7: C:\Users\Eitan\workspace\SelfAnomalyDetector - ver7\JARs For Jest\commons-lang-2.6-javadoc.jar;
Line 8: C:\Users\Eitan\workspace\SelfAnomalyDetector - ver7\JARs For Jest\commons-lang-2.6-sources.jar;
Line 9: C:\Users\Eitan\workspace\SelfAnomalyDetector - ver7\JARs For Jest\commons-lang3-3.3.2.jar;
Line 10: :\Users\Eitan\workspace\SelfAnomalyDetector - ver7\JARs For Jest\commons-lang3-3.3.2-javadoc.jar;
Line 11: C:\Users\Eitan\workspace\SelfAnomalyDetector - ver7\JARs For Jest\commons-lang3-3.3.2-sources.jar;
Line 64: C:\Users\Eitan\.m2\repository\org\apache\commons\commons-lang3\3.3.2\commons-lang3-3.3.2.jar