# NoClassDefFoundError for IngestPlugin in Elasticsearch

**URL:** <https://discuss.elastic.co/t/noclassdeffounderror-for-ingestplugin-in-elasticsearch/81735>\
**Category:** Elasticsearch\
**Created:** [April 10, 2017, 2:33am UTC](https://discuss.elastic.co/t/noclassdeffounderror-for-ingestplugin-in-elasticsearch/81735 "2017-04-10T02:33:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apanimesh061](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apanimesh061/32/927_2.png) [@apanimesh061](https://discuss.elastic.co/u/apanimesh061)\
**Post date:** [April 10, 2017, 2:33am UTC](https://discuss.elastic.co/t/noclassdeffounderror-for-ingestplugin-in-elasticsearch/81735/1 "2017-04-10T02:33:57Z")

</div>

I created a library for sentiment analysis in Java. The whole source code is [here](https://github.com/apanimesh061/VaderSentimentJava).

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](https://github.com/apanimesh061/elasticsearch-sentiment-plugin).

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(SentimentAnalyzer.java:335) ~[?:?]
        at com.vader.sentiment.analyzer.SentimentAnalyzer.boostByPunctuation(SentimentAnalyzer.java:331) ~[?:?]
        at com.vader.sentiment.analyzer.SentimentAnalyzer.polarityScores(SentimentAnalyzer.java:265) ~[?:?]
        at com.vader.sentiment.analyzer.SentimentAnalyzer.getSentiment(SentimentAnalyzer.java:235) ~[?:?]
        at com.vader.sentiment.analyzer.SentimentAnalyzer.analyse(SentimentAnalyzer.java:54) ~[?:?]
        at org.elasticsearch.plugin.ingest.vader.processor.VaderProcessor.execute(VaderProcessor.java:93) ~[?:?]
        at org.elasticsearch.action.ingest.TrackingResultProcessor.execute(TrackingResultProcessor.java:47) ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.ingest.CompoundProcessor.execute(CompoundProcessor.java:100) ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.action.ingest.SimulateExecutionService.executeDocument(SimulateExecutionService.java:49) ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.action.ingest.SimulateExecutionService$1.doRun(SimulateExecutionService.java:70) ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:596) ~[elasticsearch-5.2.1.jar:5.2.1]
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-5.2.1.jar:5.2.1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_121]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_121]
        at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814) ~[?:1.8.0_121]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_121]
        ... 15 more

```

[POM file](https://github.com/apanimesh061/VaderSentimentJava/blob/master/pom.xml) for Sentiment Analysis Library.

[POM file](https://github.com/apanimesh061/elasticsearch-sentiment-plugin/blob/master/pom.xml) for Ingest Plugin.

I am not sure how to solve this issue?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 10, 2017, 5:21am UTC](https://discuss.elastic.co/t/noclassdeffounderror-for-ingestplugin-in-elasticsearch/81735/2 "2017-04-10T05:21:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![apanimesh061](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apanimesh061/32/927_2.png) [@apanimesh061](https://discuss.elastic.co/u/apanimesh061)\
**Post date:** [April 11, 2017, 2:01pm UTC](https://discuss.elastic.co/t/noclassdeffounderror-for-ingestplugin-in-elasticsearch/81735/3 "2017-04-11T14:01:21Z")

</div>

Thanks for the reply.  
Your suggestion worked!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 9, 2017, 2:05pm UTC](https://discuss.elastic.co/t/noclassdeffounderror-for-ingestplugin-in-elasticsearch/81735/4 "2017-05-09T14:05:02Z")

</div>

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