NoClassDefFoundError for IngestPlugin in Elasticsearch

I created a library for sentiment analysis in Java. The whole source code is here.

I wanted to add this implementation as a part of an ingestion pipeline using Ingestion plugin in Elasticsearch. For that I designed a plugin which is still development stage and the source is available here.

The plugin installs correctly but when I send the following request to ES:

  "pipeline": {
    "description": "Apply VADER sentiment analysis on text.",
    "processors": [
        "vader_analyzer": {
          "field": "input",
          "positive_polarity": "positive_polarity",
          "negative_polarity": "negative_polarity",
          "neutral_polarity": "neutral_polarity",
          "compound_polarity": "compound_polarity"
    "version": 1
  "docs": [
      "_source": {
        "input": "The plot was good, but the characters are uncompelling and the dialog is not great."

I get the following error:

java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
        at com.vader.sentiment.analyzer.SentimentAnalyzer.boostByExclamation( ~[?:?]
        at com.vader.sentiment.analyzer.SentimentAnalyzer.boostByPunctuation( ~[?:?]
        at com.vader.sentiment.analyzer.SentimentAnalyzer.polarityScores( ~[?:?]
        at com.vader.sentiment.analyzer.SentimentAnalyzer.getSentiment( ~[?:?]
        at com.vader.sentiment.analyzer.SentimentAnalyzer.analyse( ~[?:?]
        at org.elasticsearch.plugin.ingest.vader.processor.VaderProcessor.execute( ~[?:?]
        at org.elasticsearch.action.ingest.TrackingResultProcessor.execute( ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.ingest.CompoundProcessor.execute( ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.action.ingest.SimulateExecutionService.executeDocument( ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.action.ingest.SimulateExecutionService$1.doRun( ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun( ~[elasticsearch-5.2.1.jar:5.2.1]
        at ~[elasticsearch-5.2.1.jar:5.2.1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker( ~[?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$ ~[?:1.8.0_121]
        at [?:1.8.0_121]
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
        at ~[?:1.8.0_121]
        at java.lang.ClassLoader.loadClass( ~[?:1.8.0_121]
        at ~[?:1.8.0_121]
        at java.lang.ClassLoader.loadClass( ~[?:1.8.0_121]
        ... 15 more

POM file for Sentiment Analysis Library.

POM file for Ingest Plugin.

I am not sure how to solve this issue?

Your zip file does not contain common-lang jar. Probably because of the runtime scope you put in pom.xml

Thanks for the reply.
Your suggestion worked!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.