# Could not initialize class org.elasticsearch.test.ESTestCase

**URL:** <https://discuss.elastic.co/t/could-not-initialize-class-org-elasticsearch-test-estestcase/78770>\
**Category:** Elasticsearch\
**Created:** [March 15, 2017, 10:03pm UTC](https://discuss.elastic.co/t/could-not-initialize-class-org-elasticsearch-test-estestcase/78770 "2017-03-15T22:03:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elastic\_boston](https://avatars.discourse-cdn.com/v4/letter/e/a183cd/32.png) [@elastic\_boston](https://discuss.elastic.co/u/elastic_boston)\
**Post date:** [March 15, 2017, 10:03pm UTC](https://discuss.elastic.co/t/could-not-initialize-class-org-elasticsearch-test-estestcase/78770/1 "2017-03-15T22:03:01Z")

</div>

I am trying to write a junit test which would create a org.elasticsearch.node.Node object. So I have created a class which extends ESIntegTestCase. However, when I run it, I get

java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.test.ESTestCase

What am I doing wrong? My pom.xml includes

 org.apache.lucene lucene-test-framework ${version.lucene} test org.elasticsearch.test framework ${version.elasticsearch} test com.google.guava guava 19.0

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [March 16, 2017, 9:03pm UTC](https://discuss.elastic.co/t/could-not-initialize-class-org-elasticsearch-test-estestcase/78770/2 "2017-03-16T21:03:26Z")

</div>

Usually I've seen this occur when there is a static initialization exception in the test, which causes ESTestCase to not load, and subsequent tests get the NoClassDefFoundError. Can you attach the full output of your test run?

---

<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:** [April 13, 2017, 9:03pm UTC](https://discuss.elastic.co/t/could-not-initialize-class-org-elasticsearch-test-estestcase/78770/3 "2017-04-13T21:03:27Z")

</div>

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