# Plugin development - Could not find plugin class exception

**URL:** <https://discuss.elastic.co/t/plugin-development-could-not-find-plugin-class-exception/49518>\
**Category:** Elasticsearch\
**Created:** [May 9, 2016, 6:33am UTC](https://discuss.elastic.co/t/plugin-development-could-not-find-plugin-class-exception/49518 "2016-05-09T06:33:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GuyE](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@GuyE](https://discuss.elastic.co/u/GuyE)\
**Post date:** [May 9, 2016, 6:33am UTC](https://discuss.elastic.co/t/plugin-development-could-not-find-plugin-class-exception/49518/1 "2016-05-09T06:33:51Z")

</div>

Hi,

I'm trying to upgrade a plugin from ES1.4 to ES2.3. Our plugin uses the Apache cTAKES engine to process documents before they are indexed. cTAKES apparently has an open issue at the moment which causes a URI is not hierarchical exception when it is run from a jar file as opposed to a .class files. This is caused because internally they should be using getResourceAsStream but it is not something that I can change at the moment.

My question is this, currently when I package my plugin as a .jar file under the plugin directory it starts to load but I get the URI is not hierarchical exception. In order to avoid this exception I tried placing the actual .class files under the plugin directory unpackaged from the jar file.

my plugin-descriptor.properties files has an entry

classname=com.something.something.pluginclassname

my directory structure is: j:\elastic-search-2.3.1\plugins\myplugin\com\something\something\pluginclassname.class

However I get an exception from Elastic: could not find plugin class.

Do I have to package my file as a jar file in order for elastic to find my class or am I doing something incorrectly here?

I'd appreciate any help here as I've spent several days on this trying all kinds of things.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 9, 2016, 5:52pm UTC](https://discuss.elastic.co/t/plugin-development-could-not-find-plugin-class-exception/49518/2 "2016-05-09T17:52:43Z")

</div>

> [@GuyE](#):
>
> Do I have to package my file as a jar file in order for elastic to find my class

Yes.

You should repackage cTAKES into a self-built custom jar in order to fix the `URI is not hierarchical` exception and patch the resource loader with `getResourceAsStream()` call.

---

<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:** [July 5, 2017, 10:52pm UTC](https://discuss.elastic.co/t/plugin-development-could-not-find-plugin-class-exception/49518/3 "2017-07-05T22:52:57Z")

</div>


