# How to write a custom river

**URL:** <https://discuss.elastic.co/t/how-to-write-a-custom-river/17305>\
**Category:** Elasticsearch\
**Created:** [May 1, 2014, 6:40pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305 "2014-05-01T18:40:52Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_chan/32/60060_2.png) [@Joshua\_Chan](https://discuss.elastic.co/u/Joshua_Chan)\
**Post date:** [May 1, 2014, 6:40pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/1 "2014-05-01T18:40:52Z")

</div>

I'm making my first go at writing a river. (Here's the source code:  
[https://bitbucket.org/futurechan/example-river/src](https://bitbucket.org/futurechan/example-river/src))

I followed this tutorial

> **[How to write an elasticsearch river plugin](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/)**
>
> Up until now I told you why I think elasticsearch is so cool and how you can use it combined with Spring. It’s now time to get to something a little more technical. For example, once you have a sea…

and compared it to this existing river

> **[jprante/elasticsearch-jdbc](https://github.com/jprante/elasticsearch-jdbc)**
>
> elasticsearch-jdbc - JDBC importer for Elasticsearch

but I haven't had much luck.

To deploy the river, I created a folder called example-river under plugins,  
dropped my jar in that folder, and restarted the node. Everything starts up  
fine.

I have also tried bin/plugin --url file:///path/to/plugin --install  
example-river, which seems to work, but it unpacks my jar. So, I tried  
zipping it first and then installing, which works and does not unpack my  
jar, but it didn't help.

When I issue this PUT request:

[http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
{  
"type": "example\_river",  
"example\_river":{  
"blah":"blah"  
}  
}

I get this exception:

[2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
[2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
java.net.URLClassLoader$1.run(Unknown Source) at  
java.security.AccessController.doPrivileged(Native Method) 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) at  
org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more

Can someone point out what I am missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/938bb394-f7b3-4a96-8618-7f4ed075f0ed%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/938bb394-f7b3-4a96-8618-7f4ed075f0ed%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rob\_Ottaway](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rob_ottaway/32/1597_2.png) [@Rob\_Ottaway](https://discuss.elastic.co/u/Rob_Ottaway)\
**Post date:** [May 1, 2014, 10:21pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/2 "2014-05-01T22:21:59Z")

</div>

This strikes me as odd:

java.lang.ClassNotFoundException: example\_river

Assume you didn't map the string example\_river to the actual class name  
properly?

-Rob

On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:

> I'm making my first go at writing a river. (Here's the source code:  
> [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> 
> I followed this tutorial
> 
> [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/)
> 
> and compared it to this existing river  
> [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> 
> but I haven't had much luck.
> 
> To deploy the river, I created a folder called example-river under  
> plugins, dropped my jar in that folder, and restarted the node. Everything  
> starts up fine.
> 
> I have also tried bin/plugin --url file:///path/to/plugin --install  
> example-river, which seems to work, but it unpacks my jar. So, I tried  
> zipping it first and then installing, which works and does not unpack my  
> jar, but it didn't help.
> 
> When I issue this PUT request:
> 
> [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> {  
> "type": "example\_river",  
> "example\_river":{  
> "blah":"blah"  
> }  
> }
> 
> I get this exception:
> 
> [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> java.net.URLClassLoader$1.run(Unknown Source) at  
> java.security.AccessController.doPrivileged(Native Method) 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) at  
> org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> 
> Can someone point out what I am missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d3df7c6c-c62a-476a-935d-c49636be66d8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d3df7c6c-c62a-476a-935d-c49636be66d8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rob\_Ottaway](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rob_ottaway/32/1597_2.png) [@Rob\_Ottaway](https://discuss.elastic.co/u/Rob_Ottaway)\
**Post date:** [May 1, 2014, 10:23pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/3 "2014-05-01T22:23:25Z")

</div>

Look at this file in your BB repo:

[https://bitbucket.org/futurechan/example-river/src/fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-plugin.properties?at=master](https://bitbucket.org/futurechan/example-river/src/fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-plugin.properties?at=master)

cheers

On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:

> This strikes me as odd:
> 
> java.lang.ClassNotFoundException: example\_river
> 
> Assume you didn't map the string example\_river to the actual class name  
> properly?
> 
> -Rob
> 
> On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> 
> > I'm making my first go at writing a river. (Here's the source code:  
> > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > 
> > I followed this tutorial
> > 
> > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/)
> > 
> > and compared it to this existing river  
> > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > 
> > but I haven't had much luck.
> > 
> > To deploy the river, I created a folder called example-river under  
> > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > starts up fine.
> > 
> > I have also tried bin/plugin --url file:///path/to/plugin --install  
> > example-river, which seems to work, but it unpacks my jar. So, I tried  
> > zipping it first and then installing, which works and does not unpack my  
> > jar, but it didn't help.
> > 
> > When I issue this PUT request:
> > 
> > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > {  
> > "type": "example\_river",  
> > "example\_river":{  
> > "blah":"blah"  
> > }  
> > }
> > 
> > I get this exception:
> > 
> > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > java.net.URLClassLoader$1.run(Unknown Source) at  
> > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > 
> > Can someone point out what I am missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/505124e5-ff08-4ad0-b135-a2e1d31c68ba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/505124e5-ff08-4ad0-b135-a2e1d31c68ba%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Joshua\_Chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_chan/32/60060_2.png) [@Joshua\_Chan](https://discuss.elastic.co/u/Joshua_Chan)\
**Post date:** [May 2, 2014, 12:47am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/4 "2014-05-02T00:47:31Z")

</div>

Thanks Rob. Someone else also told me the plugin property should be the  
fully qualified name. I didn't declare a package, so I guess I'm using the  
default package, and I thought I had the namespacing right since IntelliJ  
corrected the class name when I wrote it.

Thoughts?

-Josh

On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:

> Look at this file in your BB repo:
> 
> [Bitbucket](https://bitbucket.org/futurechan/example-river/src/fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-plugin.properties?at=master)
> 
> cheers
> 
> On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> 
> > This strikes me as odd:
> > 
> > java.lang.ClassNotFoundException: example\_river
> > 
> > Assume you didn't map the string example\_river to the actual class name  
> > properly?
> > 
> > -Rob
> > 
> > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > 
> > > I'm making my first go at writing a river. (Here's the source code:  
> > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > 
> > > I followed this tutorial
> > > 
> > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/)
> > > 
> > > and compared it to this existing river  
> > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > 
> > > but I haven't had much luck.
> > > 
> > > To deploy the river, I created a folder called example-river under  
> > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > starts up fine.
> > > 
> > > I have also tried bin/plugin --url file:///path/to/plugin --install  
> > > example-river, which seems to work, but it unpacks my jar. So, I tried  
> > > zipping it first and then installing, which works and does not unpack my  
> > > jar, but it didn't help.
> > > 
> > > When I issue this PUT request:
> > > 
> > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > {  
> > > "type": "example\_river",  
> > > "example\_river":{  
> > > "blah":"blah"  
> > > }  
> > > }
> > > 
> > > I get this exception:
> > > 
> > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > 
> > > Can someone point out what I am missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bd4a93ce-aa22-4da7-b7ad-34a451254955%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bd4a93ce-aa22-4da7-b7ad-34a451254955%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Joshua\_Chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_chan/32/60060_2.png) [@Joshua\_Chan](https://discuss.elastic.co/u/Joshua_Chan)\
**Post date:** [May 2, 2014, 1:13am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/5 "2014-05-02T01:13:28Z")

</div>

I modified the namespacing in both the properties file and by introducing a  
package that would correspond.  
It still didn't work.  
I've checked it back into the repo.

On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:

> Look at this file in your BB repo:
> 
> [Bitbucket](https://bitbucket.org/futurechan/example-river/src/fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-plugin.properties?at=master)
> 
> cheers
> 
> On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> 
> > This strikes me as odd:
> > 
> > java.lang.ClassNotFoundException: example\_river
> > 
> > Assume you didn't map the string example\_river to the actual class name  
> > properly?
> > 
> > -Rob
> > 
> > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > 
> > > I'm making my first go at writing a river. (Here's the source code:  
> > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > 
> > > I followed this tutorial
> > > 
> > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/)
> > > 
> > > and compared it to this existing river  
> > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > 
> > > but I haven't had much luck.
> > > 
> > > To deploy the river, I created a folder called example-river under  
> > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > starts up fine.
> > > 
> > > I have also tried bin/plugin --url file:///path/to/plugin --install  
> > > example-river, which seems to work, but it unpacks my jar. So, I tried  
> > > zipping it first and then installing, which works and does not unpack my  
> > > jar, but it didn't help.
> > > 
> > > When I issue this PUT request:
> > > 
> > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > {  
> > > "type": "example\_river",  
> > > "example\_river":{  
> > > "blah":"blah"  
> > > }  
> > > }
> > > 
> > > I get this exception:
> > > 
> > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > 
> > > Can someone point out what I am missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a29bcb00-b537-4e37-9387-f278b3dec157%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a29bcb00-b537-4e37-9387-f278b3dec157%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rob\_Ottaway](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rob_ottaway/32/1597_2.png) [@Rob\_Ottaway](https://discuss.elastic.co/u/Rob_Ottaway)\
**Post date:** [May 2, 2014, 2:49am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/6 "2014-05-02T02:49:11Z")

</div>

Look at this plugin for help:

[https://github.com/elasticsearch/elasticsearch-cloud-aws/blob/master/src/main/resources/es-plugin.properties](https://github.com/elasticsearch/elasticsearch-cloud-aws/blob/master/src/main/resources/es-plugin.properties)

Yes it needs to be the FQN.

On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:

> Thanks Rob. Someone else also told me the plugin property should be the  
> fully qualified name. I didn't declare a package, so I guess I'm using the  
> default package, and I thought I had the namespacing right since IntelliJ  
> corrected the class name when I wrote it.
> 
> Thoughts?
> 
> -Josh
> 
> On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> 
> > Look at this file in your BB repo:
> > 
> > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-plugin.properties?at=master)
> > 
> > cheers
> > 
> > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > 
> > > This strikes me as odd:
> > > 
> > > java.lang.ClassNotFoundException: example\_river
> > > 
> > > Assume you didn't map the string example\_river to the actual class name  
> > > properly?
> > > 
> > > -Rob
> > > 
> > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > 
> > > > I'm making my first go at writing a river. (Here's the source code:  
> > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > 
> > > > I followed this tutorial
> > > > 
> > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/)
> > > > 
> > > > and compared it to this existing river  
> > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > 
> > > > but I haven't had much luck.
> > > > 
> > > > To deploy the river, I created a folder called example-river under  
> > > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > > starts up fine.
> > > > 
> > > > I have also tried bin/plugin --url file:///path/to/plugin --install  
> > > > example-river, which seems to work, but it unpacks my jar. So, I tried  
> > > > zipping it first and then installing, which works and does not unpack my  
> > > > jar, but it didn't help.
> > > > 
> > > > When I issue this PUT request:
> > > > 
> > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > {  
> > > > "type": "example\_river",  
> > > > "example\_river":{  
> > > > "blah":"blah"  
> > > > }  
> > > > }
> > > > 
> > > > I get this exception:
> > > > 
> > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > 
> > > > Can someone point out what I am missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fce8a8f1-b73a-406a-b591-17664369a5f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fce8a8f1-b73a-406a-b591-17664369a5f6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Joshua\_Chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_chan/32/60060_2.png) [@Joshua\_Chan](https://discuss.elastic.co/u/Joshua_Chan)\
**Post date:** [May 2, 2014, 3:04am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/7 "2014-05-02T03:04:34Z")

</div>

So, that's what I did, but no love... I checked in the latest.

-Josh

On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:

> Look at this plugin for help:
> 
> [https://github.com/elasticsearch/elasticsearch-cloud-aws/blob/master/src/main/resources/es-plugin.properties](https://github.com/elasticsearch/elasticsearch-cloud-aws/blob/master/src/main/resources/es-plugin.properties)
> 
> Yes it needs to be the FQN.
> 
> On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> 
> > Thanks Rob. Someone else also told me the plugin property should be the  
> > fully qualified name. I didn't declare a package, so I guess I'm using the  
> > default package, and I thought I had the namespacing right since IntelliJ  
> > corrected the class name when I wrote it.
> > 
> > Thoughts?
> > 
> > -Josh
> > 
> > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > 
> > > Look at this file in your BB repo:
> > > 
> > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-plugin.properties?at=master)
> > > 
> > > cheers
> > > 
> > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > 
> > > > This strikes me as odd:
> > > > 
> > > > java.lang.ClassNotFoundException: example\_river
> > > > 
> > > > Assume you didn't map the string example\_river to the actual class name  
> > > > properly?
> > > > 
> > > > -Rob
> > > > 
> > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > 
> > > > > I'm making my first go at writing a river. (Here's the source code:  
> > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > 
> > > > > I followed this tutorial
> > > > > 
> > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/)
> > > > > 
> > > > > and compared it to this existing river  
> > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > 
> > > > > but I haven't had much luck.
> > > > > 
> > > > > To deploy the river, I created a folder called example-river under  
> > > > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > > > starts up fine.
> > > > > 
> > > > > I have also tried bin/plugin --url file:///path/to/plugin --install  
> > > > > example-river, which seems to work, but it unpacks my jar. So, I  
> > > > > tried zipping it first and then installing, which works and does not unpack  
> > > > > my jar, but it didn't help.
> > > > > 
> > > > > When I issue this PUT request:
> > > > > 
> > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > {  
> > > > > "type": "example\_river",  
> > > > > "example\_river":{  
> > > > > "blah":"blah"  
> > > > > }  
> > > > > }
> > > > > 
> > > > > I get this exception:
> > > > > 
> > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > 
> > > > > Can someone point out what I am missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rob\_Ottaway](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rob_ottaway/32/1597_2.png) [@Rob\_Ottaway](https://discuss.elastic.co/u/Rob_Ottaway)\
**Post date:** [May 2, 2014, 4:08am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/8 "2014-05-02T04:08:28Z")

</div>

I should have sent you the following earlier rather than a non-river plugin:

the plugin:

> <https://github.com/elastic/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java>

The river implementation:

> <https://github.com/elastic/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java>

The module:

> <https://github.com/elastic/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java>

Looks like you are registering the river implementation rather than the  
river module hence the not working. Had to look at an example I know works  
to figure it out.

-Rob

On Thu, May 1, 2014 at 8:04 PM, Joshua Chan  
[joshua.bennett.chan@gmail.com](mailto:joshua.bennett.chan@gmail.com)wrote:

> So, that's what I did, but no love... I checked in the latest.
> 
> -Josh
> 
> On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> 
> > Look at this plugin for help:
> > 
> > [https://github.com/elasticsearch/elasticsearch-cloud-aws/blob/master/src/](https://github.com/elasticsearch/elasticsearch-cloud-aws/blob/master/src/)  
> > main/resources/es-plugin.properties
> > 
> > Yes it needs to be the FQN.
> > 
> > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > 
> > > Thanks Rob. Someone else also told me the plugin property should be the  
> > > fully qualified name. I didn't declare a package, so I guess I'm using the  
> > > default package, and I thought I had the namespacing right since IntelliJ  
> > > corrected the class name when I wrote it.
> > > 
> > > Thoughts?
> > > 
> > > -Josh
> > > 
> > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > 
> > > > Look at this file in your BB repo:
> > > > 
> > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/)  
> > > > fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/  
> > > > es-plugin.properties?at=master
> > > > 
> > > > cheers
> > > > 
> > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > 
> > > > > This strikes me as odd:
> > > > > 
> > > > > java.lang.ClassNotFoundException: example\_river
> > > > > 
> > > > > Assume you didn't map the string example\_river to the actual class  
> > > > > name properly?
> > > > > 
> > > > > -Rob
> > > > > 
> > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > 
> > > > > > I'm making my first go at writing a river. (Here's the source code:  
> > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > 
> > > > > > I followed this tutorial  
> > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-)  
> > > > > > elasticsearch-river-plugin/
> > > > > > 
> > > > > > and compared it to this existing river  
> > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > 
> > > > > > but I haven't had much luck.
> > > > > > 
> > > > > > To deploy the river, I created a folder called example-river under  
> > > > > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > > > > starts up fine.
> > > > > > 
> > > > > > I have also tried bin/plugin --url file:///path/to/plugin --install  
> > > > > > example-river, which seems to work, but it unpacks my jar. So, I  
> > > > > > tried zipping it first and then installing, which works and does not unpack  
> > > > > > my jar, but it didn't help.
> > > > > > 
> > > > > > When I issue this PUT request:
> > > > > > 
> > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > {  
> > > > > > "type": "example\_river",  
> > > > > > "example\_river":{  
> > > > > > "blah":"blah"  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > I get this exception:
> > > > > > 
> > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > 
> > > > > > Can someone point out what I am missing?
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to a topic in the  
> > > > > Google Groups "elasticsearch" group.  
> > > > > To unsubscribe from this topic, visit  
> > > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe).  
> > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > > > To view this discussion on the web visit  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAB-KG0uh5-7Rsq3DyQto-h7EhsD%2BGjNyTP2dD32F0hcbKgMwbg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAB-KG0uh5-7Rsq3DyQto-h7EhsD%2BGjNyTP2dD32F0hcbKgMwbg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [May 2, 2014, 8:31am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/9 "2014-05-02T08:31:23Z")

</div>

Hi Joshua,  
the package is not an issue if you are using the default one for your  
classes. Looking deeper, the type of the river that you try to register  
with your rest call doesn't match the type of the river you registered in  
the plugin when you did module.registerRiver(type, riverclass).

Cheers  
Luca

On Friday, May 2, 2014 6:08:28 AM UTC+2, Rob Ottaway wrote:

> I should have sent you the following earlier rather than a non-river  
> plugin:
> 
> the plugin:
> 
> [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java)
> 
> The river implementation:
> 
> [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java)
> 
> The module:
> 
> [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java)
> 
> Looks like you are registering the river implementation rather than the  
> river module hence the not working. Had to look at an example I know works  
> to figure it out.
> 
> -Rob
> 
> On Thu, May 1, 2014 at 8:04 PM, Joshua Chan \<[joshua.bennett.chan@gmail.com](mailto:joshua.bennett.chan@gmail.com)
> 
> > wrote:
> 
> > So, that's what I did, but no love... I checked in the latest.
> > 
> > -Josh
> > 
> > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > 
> > > Look at this plugin for help:
> > > 
> > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > cloud-aws/blob/master/src/main/resources/es-plugin.properties
> > > 
> > > Yes it needs to be the FQN.
> > > 
> > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > 
> > > > Thanks Rob. Someone else also told me the plugin property should be the  
> > > > fully qualified name. I didn't declare a package, so I guess I'm using the  
> > > > default package, and I thought I had the namespacing right since IntelliJ  
> > > > corrected the class name when I wrote it.
> > > > 
> > > > Thoughts?
> > > > 
> > > > -Josh
> > > > 
> > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > 
> > > > > Look at this file in your BB repo:
> > > > > 
> > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/)  
> > > > > fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/  
> > > > > es-plugin.properties?at=master
> > > > > 
> > > > > cheers
> > > > > 
> > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > 
> > > > > > This strikes me as odd:
> > > > > > 
> > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > 
> > > > > > Assume you didn't map the string example\_river to the actual class  
> > > > > > name properly?
> > > > > > 
> > > > > > -Rob
> > > > > > 
> > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > 
> > > > > > > I'm making my first go at writing a river. (Here's the source code:  
> > > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > 
> > > > > > > I followed this tutorial  
> > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-)  
> > > > > > > elasticsearch-river-plugin/
> > > > > > > 
> > > > > > > and compared it to this existing river  
> > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > 
> > > > > > > but I haven't had much luck.
> > > > > > > 
> > > > > > > To deploy the river, I created a folder called example-river under  
> > > > > > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > > > > > starts up fine.
> > > > > > > 
> > > > > > > I have also tried bin/plugin --url file:///path/to/plugin --install  
> > > > > > > example-river, which seems to work, but it unpacks my jar. So, I  
> > > > > > > tried zipping it first and then installing, which works and does not unpack  
> > > > > > > my jar, but it didn't help.
> > > > > > > 
> > > > > > > When I issue this PUT request:
> > > > > > > 
> > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > {  
> > > > > > > "type": "example\_river",  
> > > > > > > "example\_river":{  
> > > > > > > "blah":"blah"  
> > > > > > > }  
> > > > > > > }
> > > > > > > 
> > > > > > > I get this exception:
> > > > > > > 
> > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > 
> > > > > > > Can someone point out what I am missing?
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to a topic in the  
> > > > > > Google Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this topic, visit  
> > > > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe).  
> > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > > > > To view this discussion on the web visit  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a62a0f18-e3d7-41ad-84ed-a2c60a07335e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a62a0f18-e3d7-41ad-84ed-a2c60a07335e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Joshua\_Chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_chan/32/60060_2.png) [@Joshua\_Chan](https://discuss.elastic.co/u/Joshua_Chan)\
**Post date:** [May 2, 2014, 1:49pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/10 "2014-05-02T13:49:02Z")

</div>

I've tried this too with no luck

[http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
{  
"type": "river",  
"river":{  
"blah":"blah"  
}  
}

On Friday, May 2, 2014 3:31:23 AM UTC-5, Luca Cavanna wrote:

> Hi Joshua,  
> the package is not an issue if you are using the default one for your  
> classes. Looking deeper, the type of the river that you try to register  
> with your rest call doesn't match the type of the river you registered in  
> the plugin when you did module.registerRiver(type, riverclass).
> 
> Cheers  
> Luca
> 
> On Friday, May 2, 2014 6:08:28 AM UTC+2, Rob Ottaway wrote:
> 
> > I should have sent you the following earlier rather than a non-river  
> > plugin:
> > 
> > the plugin:
> > 
> > [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java)
> > 
> > The river implementation:
> > 
> > [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java)
> > 
> > The module:
> > 
> > [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java)
> > 
> > Looks like you are registering the river implementation rather than the  
> > river module hence the not working. Had to look at an example I know works  
> > to figure it out.
> > 
> > -Rob
> > 
> > On Thu, May 1, 2014 at 8:04 PM, Joshua Chan \<[joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)\<javascript:\>
> > 
> > > wrote:
> > 
> > > So, that's what I did, but no love... I checked in the latest.
> > > 
> > > -Josh
> > > 
> > > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > > 
> > > > Look at this plugin for help:
> > > > 
> > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > cloud-aws/blob/master/src/main/resources/es-plugin.properties
> > > > 
> > > > Yes it needs to be the FQN.
> > > > 
> > > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > > 
> > > > > Thanks Rob. Someone else also told me the plugin property should be  
> > > > > the fully qualified name. I didn't declare a package, so I guess I'm using  
> > > > > the default package, and I thought I had the namespacing right since  
> > > > > IntelliJ corrected the class name when I wrote it.
> > > > > 
> > > > > Thoughts?
> > > > > 
> > > > > -Josh
> > > > > 
> > > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > > 
> > > > > > Look at this file in your BB repo:
> > > > > > 
> > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/)  
> > > > > > fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/  
> > > > > > es-plugin.properties?at=master
> > > > > > 
> > > > > > cheers
> > > > > > 
> > > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > > 
> > > > > > > This strikes me as odd:
> > > > > > > 
> > > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > > 
> > > > > > > Assume you didn't map the string example\_river to the actual class  
> > > > > > > name properly?
> > > > > > > 
> > > > > > > -Rob
> > > > > > > 
> > > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > > 
> > > > > > > > I'm making my first go at writing a river. (Here's the source code:  
> > > > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > > 
> > > > > > > > I followed this tutorial  
> > > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-)  
> > > > > > > > elasticsearch-river-plugin/
> > > > > > > > 
> > > > > > > > and compared it to this existing river  
> > > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > > 
> > > > > > > > but I haven't had much luck.
> > > > > > > > 
> > > > > > > > To deploy the river, I created a folder called example-river under  
> > > > > > > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > > > > > > starts up fine.
> > > > > > > > 
> > > > > > > > I have also tried bin/plugin --url file:///path/to/plugin  
> > > > > > > > --install example-river, which seems to work, but it unpacks my  
> > > > > > > > jar. So, I tried zipping it first and then installing, which works and does  
> > > > > > > > not unpack my jar, but it didn't help.
> > > > > > > > 
> > > > > > > > When I issue this PUT request:
> > > > > > > > 
> > > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > > {  
> > > > > > > > "type": "example\_river",  
> > > > > > > > "example\_river":{  
> > > > > > > > "blah":"blah"  
> > > > > > > > }  
> > > > > > > > }
> > > > > > > > 
> > > > > > > > I get this exception:
> > > > > > > > 
> > > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > > 
> > > > > > > > Can someone point out what I am missing?
> > > > > > > 
> > > > > > > --  
> > > > > > > You received this message because you are subscribed to a topic in the  
> > > > > > > Google Groups "elasticsearch" group.  
> > > > > > > To unsubscribe from this topic, visit  
> > > > > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe).  
> > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > > > > To view this discussion on the web visit  
> > > > > > > [https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Joshua\_Chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_chan/32/60060_2.png) [@Joshua\_Chan](https://discuss.elastic.co/u/Joshua_Chan)\
**Post date:** [May 2, 2014, 1:51pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/11 "2014-05-02T13:51:42Z")

</div>

I'm not sure I follow.

In my Plugin.onModule I have  
public void onModule(RiversModule module) {  
module.registerRiver(RiverImpl.TYPE, ModuleImpl.class);

[//client.admin](https://client.admin)().indices().prepareDeleteMapping("\_river").setType(riverName.name()).execute();  
}

And on my Module I have  
protected void configure() {  
bind(River.class).to(RiverImpl.class).asEagerSingleton();  
}

On Thursday, May 1, 2014 11:08:28 PM UTC-5, Rob Ottaway wrote:

> I should have sent you the following earlier rather than a non-river  
> plugin:
> 
> the plugin:
> 
> [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java)
> 
> The river implementation:
> 
> [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java)
> 
> The module:
> 
> [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java)
> 
> Looks like you are registering the river implementation rather than the  
> river module hence the not working. Had to look at an example I know works  
> to figure it out.
> 
> -Rob
> 
> On Thu, May 1, 2014 at 8:04 PM, Joshua Chan \<[joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > So, that's what I did, but no love... I checked in the latest.
> > 
> > -Josh
> > 
> > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > 
> > > Look at this plugin for help:
> > > 
> > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > cloud-aws/blob/master/src/main/resources/es-plugin.properties
> > > 
> > > Yes it needs to be the FQN.
> > > 
> > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > 
> > > > Thanks Rob. Someone else also told me the plugin property should be the  
> > > > fully qualified name. I didn't declare a package, so I guess I'm using the  
> > > > default package, and I thought I had the namespacing right since IntelliJ  
> > > > corrected the class name when I wrote it.
> > > > 
> > > > Thoughts?
> > > > 
> > > > -Josh
> > > > 
> > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > 
> > > > > Look at this file in your BB repo:
> > > > > 
> > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/)  
> > > > > fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/  
> > > > > es-plugin.properties?at=master
> > > > > 
> > > > > cheers
> > > > > 
> > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > 
> > > > > > This strikes me as odd:
> > > > > > 
> > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > 
> > > > > > Assume you didn't map the string example\_river to the actual class  
> > > > > > name properly?
> > > > > > 
> > > > > > -Rob
> > > > > > 
> > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > 
> > > > > > > I'm making my first go at writing a river. (Here's the source code:  
> > > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > 
> > > > > > > I followed this tutorial  
> > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-)  
> > > > > > > elasticsearch-river-plugin/
> > > > > > > 
> > > > > > > and compared it to this existing river  
> > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > 
> > > > > > > but I haven't had much luck.
> > > > > > > 
> > > > > > > To deploy the river, I created a folder called example-river under  
> > > > > > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > > > > > starts up fine.
> > > > > > > 
> > > > > > > I have also tried bin/plugin --url file:///path/to/plugin --install  
> > > > > > > example-river, which seems to work, but it unpacks my jar. So, I  
> > > > > > > tried zipping it first and then installing, which works and does not unpack  
> > > > > > > my jar, but it didn't help.
> > > > > > > 
> > > > > > > When I issue this PUT request:
> > > > > > > 
> > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > {  
> > > > > > > "type": "example\_river",  
> > > > > > > "example\_river":{  
> > > > > > > "blah":"blah"  
> > > > > > > }  
> > > > > > > }
> > > > > > > 
> > > > > > > I get this exception:
> > > > > > > 
> > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > 
> > > > > > > Can someone point out what I am missing?
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to a topic in the  
> > > > > > Google Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this topic, visit  
> > > > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe).  
> > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > > > To view this discussion on the web visit  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/232f7c30-01e8-48c2-9f62-e0c37f90052c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/232f7c30-01e8-48c2-9f62-e0c37f90052c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Joshua\_Chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_chan/32/60060_2.png) [@Joshua\_Chan](https://discuss.elastic.co/u/Joshua_Chan)\
**Post date:** [May 2, 2014, 2:11pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/12 "2014-05-02T14:11:31Z")

</div>

org.elasticsearch.common.settings.NoClassSettingsException: Failed to load  
class with value [river]  
at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.  
java:87)  
at org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java  
:58)  
at org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder  
.java:44)  
at org.elasticsearch.river.RiversService.createRiver(RiversService.  
java:137)  
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(  
RiversService.java:275)  
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(  
RiversService.java:269)  
at org.elasticsearch.action.support.  
TransportAction$ThreadedActionListener$1.run(TransportAction.java:93)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source  
)  
at java.lang.Thread.run(Unknown Source)  
Caused by: java.lang.ClassNotFoundException: river  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.security.AccessController.doPrivileged(Native Method)  
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)  
at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.  
java:73)  
... 9 more

On Friday, May 2, 2014 8:51:42 AM UTC-5, Joshua Chan wrote:

> I'm not sure I follow.
> 
> In my Plugin.onModule I have  
> public void onModule(RiversModule module) {  
> module.registerRiver(RiverImpl.TYPE, ModuleImpl.class);
> 
> [//client.admin](https://client.admin)().indices().prepareDeleteMapping("\_river").setType(riverName.name()).execute();  
> }
> 
> And on my Module I have  
> protected void configure() {  
> bind(River.class).to(RiverImpl.class).asEagerSingleton();  
> }
> 
> On Thursday, May 1, 2014 11:08:28 PM UTC-5, Rob Ottaway wrote:
> 
> > I should have sent you the following earlier rather than a non-river  
> > plugin:
> > 
> > the plugin:
> > 
> > [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java)
> > 
> > The river implementation:
> > 
> > [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiver.java)
> > 
> > The module:
> > 
> > [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/java/org/elasticsearch/river/rabbitmq/RabbitmqRiverModule.java)
> > 
> > Looks like you are registering the river implementation rather than the  
> > river module hence the not working. Had to look at an example I know works  
> > to figure it out.
> > 
> > -Rob
> > 
> > On Thu, May 1, 2014 at 8:04 PM, Joshua Chan [joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)wrote:
> > 
> > > So, that's what I did, but no love... I checked in the latest.
> > > 
> > > -Josh
> > > 
> > > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > > 
> > > > Look at this plugin for help:
> > > > 
> > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > cloud-aws/blob/master/src/main/resources/es-plugin.properties
> > > > 
> > > > Yes it needs to be the FQN.
> > > > 
> > > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > > 
> > > > > Thanks Rob. Someone else also told me the plugin property should be  
> > > > > the fully qualified name. I didn't declare a package, so I guess I'm using  
> > > > > the default package, and I thought I had the namespacing right since  
> > > > > IntelliJ corrected the class name when I wrote it.
> > > > > 
> > > > > Thoughts?
> > > > > 
> > > > > -Josh
> > > > > 
> > > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > > 
> > > > > > Look at this file in your BB repo:
> > > > > > 
> > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/)  
> > > > > > fd23648c3e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/  
> > > > > > es-plugin.properties?at=master
> > > > > > 
> > > > > > cheers
> > > > > > 
> > > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > > 
> > > > > > > This strikes me as odd:
> > > > > > > 
> > > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > > 
> > > > > > > Assume you didn't map the string example\_river to the actual class  
> > > > > > > name properly?
> > > > > > > 
> > > > > > > -Rob
> > > > > > > 
> > > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > > 
> > > > > > > > I'm making my first go at writing a river. (Here's the source code:  
> > > > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > > 
> > > > > > > > I followed this tutorial  
> > > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-)  
> > > > > > > > elasticsearch-river-plugin/
> > > > > > > > 
> > > > > > > > and compared it to this existing river  
> > > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > > 
> > > > > > > > but I haven't had much luck.
> > > > > > > > 
> > > > > > > > To deploy the river, I created a folder called example-river under  
> > > > > > > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > > > > > > starts up fine.
> > > > > > > > 
> > > > > > > > I have also tried bin/plugin --url file:///path/to/plugin  
> > > > > > > > --install example-river, which seems to work, but it unpacks my  
> > > > > > > > jar. So, I tried zipping it first and then installing, which works and does  
> > > > > > > > not unpack my jar, but it didn't help.
> > > > > > > > 
> > > > > > > > When I issue this PUT request:
> > > > > > > > 
> > > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > > {  
> > > > > > > > "type": "example\_river",  
> > > > > > > > "example\_river":{  
> > > > > > > > "blah":"blah"  
> > > > > > > > }  
> > > > > > > > }
> > > > > > > > 
> > > > > > > > I get this exception:
> > > > > > > > 
> > > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > > 
> > > > > > > > Can someone point out what I am missing?
> > > > > > > 
> > > > > > > --  
> > > > > > > You received this message because you are subscribed to a topic in the  
> > > > > > > Google Groups "elasticsearch" group.  
> > > > > > > To unsubscribe from this topic, visit  
> > > > > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe).  
> > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > To view this discussion on the web visit  
> > > > > > > [https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9152bf7a-98ac-4157-bacd-0af804960b6a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9152bf7a-98ac-4157-bacd-0af804960b6a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rob\_Ottaway](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rob_ottaway/32/1597_2.png) [@Rob\_Ottaway](https://discuss.elastic.co/u/Rob_Ottaway)\
**Post date:** [May 2, 2014, 5:33pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/13 "2014-05-02T17:33:12Z")

</div>

I think he means in your Guice module. You are registering the WRONG thing  
😉

On Fri, May 2, 2014 at 6:49 AM, Joshua Chan  
[joshua.bennett.chan@gmail.com](mailto:joshua.bennett.chan@gmail.com)wrote:

> I've tried this too with no luck
> 
> [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> {  
> "type": "river",  
> "river":{  
> "blah":"blah"  
> }  
> }
> 
> On Friday, May 2, 2014 3:31:23 AM UTC-5, Luca Cavanna wrote:
> 
> > Hi Joshua,  
> > the package is not an issue if you are using the default one for your  
> > classes. Looking deeper, the type of the river that you try to register  
> > with your rest call doesn't match the type of the river you registered in  
> > the plugin when you did module.registerRiver(type, riverclass).
> > 
> > Cheers  
> > Luca
> > 
> > On Friday, May 2, 2014 6:08:28 AM UTC+2, Rob Ottaway wrote:
> > 
> > > I should have sent you the following earlier rather than a non-river  
> > > plugin:
> > > 
> > > the plugin:  
> > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > river-rabbitmq/blob/master/src/main/java/org/elasticsearch/plugin/river/  
> > > rabbitmq/RabbitmqRiverPlugin.java
> > > 
> > > The river implementation:  
> > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > river-rabbitmq/blob/master/src/main/java/org/  
> > > elasticsearch/river/rabbitmq/RabbitmqRiver.java
> > > 
> > > The module:  
> > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > river-rabbitmq/blob/master/src/main/java/org/  
> > > elasticsearch/river/rabbitmq/RabbitmqRiverModule.java
> > > 
> > > Looks like you are registering the river implementation rather than the  
> > > river module hence the not working. Had to look at an example I know works  
> > > to figure it out.
> > > 
> > > -Rob
> > > 
> > > On Thu, May 1, 2014 at 8:04 PM, Joshua Chan [joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)wrote:
> > > 
> > > > So, that's what I did, but no love... I checked in the latest.
> > > > 
> > > > -Josh
> > > > 
> > > > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > > > 
> > > > > Look at this plugin for help:
> > > > > 
> > > > > [GitHub - elastic/elasticsearch-cloud-aws: AWS Cloud Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-cloud-aws/)  
> > > > > blob/master/src/main/resources/es-plugin.properties
> > > > > 
> > > > > Yes it needs to be the FQN.
> > > > > 
> > > > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > > > 
> > > > > > Thanks Rob. Someone else also told me the plugin property should be  
> > > > > > the fully qualified name. I didn't declare a package, so I guess I'm using  
> > > > > > the default package, and I thought I had the namespacing right since  
> > > > > > IntelliJ corrected the class name when I wrote it.
> > > > > > 
> > > > > > Thoughts?
> > > > > > 
> > > > > > -Josh
> > > > > > 
> > > > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > > > 
> > > > > > > Look at this file in your BB repo:
> > > > > > > 
> > > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/fd23648c3)  
> > > > > > > e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-  
> > > > > > > plugin.properties?at=master
> > > > > > > 
> > > > > > > cheers
> > > > > > > 
> > > > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > > > 
> > > > > > > > This strikes me as odd:
> > > > > > > > 
> > > > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > > > 
> > > > > > > > Assume you didn't map the string example\_river to the actual class  
> > > > > > > > name properly?
> > > > > > > > 
> > > > > > > > -Rob
> > > > > > > > 
> > > > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > > > 
> > > > > > > > > I'm making my first go at writing a river. (Here's the source  
> > > > > > > > > code: [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > > > 
> > > > > > > > > I followed this tutorial  
> > > > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticse)  
> > > > > > > > > arch-river-plugin/
> > > > > > > > > 
> > > > > > > > > and compared it to this existing river  
> > > > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > > > 
> > > > > > > > > but I haven't had much luck.
> > > > > > > > > 
> > > > > > > > > To deploy the river, I created a folder called example-river under  
> > > > > > > > > plugins, dropped my jar in that folder, and restarted the node. Everything  
> > > > > > > > > starts up fine.
> > > > > > > > > 
> > > > > > > > > I have also tried bin/plugin --url file:///path/to/plugin  
> > > > > > > > > --install example-river, which seems to work, but it unpacks my  
> > > > > > > > > jar. So, I tried zipping it first and then installing, which works and does  
> > > > > > > > > not unpack my jar, but it didn't help.
> > > > > > > > > 
> > > > > > > > > When I issue this PUT request:
> > > > > > > > > 
> > > > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > > > {  
> > > > > > > > > "type": "example\_river",  
> > > > > > > > > "example\_river":{  
> > > > > > > > > "blah":"blah"  
> > > > > > > > > }  
> > > > > > > > > }
> > > > > > > > > 
> > > > > > > > > I get this exception:
> > > > > > > > > 
> > > > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > > > 
> > > > > > > > > Can someone point out what I am missing?
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > You received this message because you are subscribed to a topic in the  
> > > > > > > > Google Groups "elasticsearch" group.  
> > > > > > > > To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > > > topic/elasticsearch/kIlh\_0hm3no/unsubscribe.  
> > > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > > > msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%  
> > > > > > > > [40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups "elasticsearch" group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe).  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAB-KG0uHK69o\_kxfzJqffp%3DfzdaDmtAiaqwLC6KO8AeATBEDhw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAB-KG0uHK69o_kxfzJqffp%3DfzdaDmtAiaqwLC6KO8AeATBEDhw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rob\_Ottaway](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rob_ottaway/32/1597_2.png) [@Rob\_Ottaway](https://discuss.elastic.co/u/Rob_Ottaway)\
**Post date:** [May 2, 2014, 5:34pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/14 "2014-05-02T17:34:47Z")

</div>

Oh sorry module is fine, it's the call to module.registerRiver which is  
being passed the River itself and not the River Guice module. Try that  
change.

On Fri, May 2, 2014 at 10:33 AM, Rob Ottaway [robottaway@gmail.com](mailto:robottaway@gmail.com) wrote:

> I think he means in your Guice module. You are registering the WRONG thing  
> 😉
> 
> On Fri, May 2, 2014 at 6:49 AM, Joshua Chan \<[joshua.bennett.chan@gmail.com](mailto:joshua.bennett.chan@gmail.com)
> 
> > wrote:
> 
> > I've tried this too with no luck
> > 
> > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > {  
> > "type": "river",  
> > "river":{  
> > "blah":"blah"  
> > }  
> > }
> > 
> > On Friday, May 2, 2014 3:31:23 AM UTC-5, Luca Cavanna wrote:
> > 
> > > Hi Joshua,  
> > > the package is not an issue if you are using the default one for your  
> > > classes. Looking deeper, the type of the river that you try to register  
> > > with your rest call doesn't match the type of the river you registered in  
> > > the plugin when you did module.registerRiver(type, riverclass).
> > > 
> > > Cheers  
> > > Luca
> > > 
> > > On Friday, May 2, 2014 6:08:28 AM UTC+2, Rob Ottaway wrote:
> > > 
> > > > I should have sent you the following earlier rather than a non-river  
> > > > plugin:
> > > > 
> > > > the plugin:  
> > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java
> > > > 
> > > > The river implementation:  
> > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > elasticsearch/river/rabbitmq/RabbitmqRiver.java
> > > > 
> > > > The module:  
> > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > elasticsearch/river/rabbitmq/RabbitmqRiverModule.java
> > > > 
> > > > Looks like you are registering the river implementation rather than the  
> > > > river module hence the not working. Had to look at an example I know works  
> > > > to figure it out.
> > > > 
> > > > -Rob
> > > > 
> > > > On Thu, May 1, 2014 at 8:04 PM, Joshua Chan [joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)wrote:
> > > > 
> > > > > So, that's what I did, but no love... I checked in the latest.
> > > > > 
> > > > > -Josh
> > > > > 
> > > > > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > > > > 
> > > > > > Look at this plugin for help:
> > > > > > 
> > > > > > [GitHub - elastic/elasticsearch-cloud-aws: AWS Cloud Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-cloud-aws/)  
> > > > > > blob/master/src/main/resources/es-plugin.properties
> > > > > > 
> > > > > > Yes it needs to be the FQN.
> > > > > > 
> > > > > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > > > > 
> > > > > > > Thanks Rob. Someone else also told me the plugin property should be  
> > > > > > > the fully qualified name. I didn't declare a package, so I guess I'm using  
> > > > > > > the default package, and I thought I had the namespacing right since  
> > > > > > > IntelliJ corrected the class name when I wrote it.
> > > > > > > 
> > > > > > > Thoughts?
> > > > > > > 
> > > > > > > -Josh
> > > > > > > 
> > > > > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > > > > 
> > > > > > > > Look at this file in your BB repo:
> > > > > > > > 
> > > > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/fd23648c3)  
> > > > > > > > e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-  
> > > > > > > > plugin.properties?at=master
> > > > > > > > 
> > > > > > > > cheers
> > > > > > > > 
> > > > > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > > > > 
> > > > > > > > > This strikes me as odd:
> > > > > > > > > 
> > > > > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > > > > 
> > > > > > > > > Assume you didn't map the string example\_river to the actual class  
> > > > > > > > > name properly?
> > > > > > > > > 
> > > > > > > > > -Rob
> > > > > > > > > 
> > > > > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > > > > 
> > > > > > > > > > I'm making my first go at writing a river. (Here's the source  
> > > > > > > > > > code: [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > > > > 
> > > > > > > > > > I followed this tutorial  
> > > > > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticse)  
> > > > > > > > > > arch-river-plugin/
> > > > > > > > > > 
> > > > > > > > > > and compared it to this existing river  
> > > > > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > > > > 
> > > > > > > > > > but I haven't had much luck.
> > > > > > > > > > 
> > > > > > > > > > To deploy the river, I created a folder called example-river  
> > > > > > > > > > under plugins, dropped my jar in that folder, and restarted the node.  
> > > > > > > > > > Everything starts up fine.
> > > > > > > > > > 
> > > > > > > > > > I have also tried bin/plugin --url file:///path/to/plugin  
> > > > > > > > > > --install example-river, which seems to work, but it unpacks my  
> > > > > > > > > > jar. So, I tried zipping it first and then installing, which works and does  
> > > > > > > > > > not unpack my jar, but it didn't help.
> > > > > > > > > > 
> > > > > > > > > > When I issue this PUT request:
> > > > > > > > > > 
> > > > > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > > > > {  
> > > > > > > > > > "type": "example\_river",  
> > > > > > > > > > "example\_river":{  
> > > > > > > > > > "blah":"blah"  
> > > > > > > > > > }  
> > > > > > > > > > }
> > > > > > > > > > 
> > > > > > > > > > I get this exception:
> > > > > > > > > > 
> > > > > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > > > > 
> > > > > > > > > > Can someone point out what I am missing?
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > You received this message because you are subscribed to a topic in the  
> > > > > > > > > Google Groups "elasticsearch" group.  
> > > > > > > > > To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > > > > topic/elasticsearch/kIlh\_0hm3no/unsubscribe.  
> > > > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > > > > msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%  
> > > > > > > > > [40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > > > .
> > > > > 
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to a topic in the  
> > > > Google Groups "elasticsearch" group.  
> > > > To unsubscribe from this topic, visit  
> > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe).  
> > > > To unsubscribe from this group and all its topics, send an email to  
> > > > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAB-KG0vk43JNE0QiQN2ANV3awxNqRd%3Dgg1gDj62eh7NOqkO%2BxQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAB-KG0vk43JNE0QiQN2ANV3awxNqRd%3Dgg1gDj62eh7NOqkO%2BxQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Joshua\_Chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_chan/32/60060_2.png) [@Joshua\_Chan](https://discuss.elastic.co/u/Joshua_Chan)\
**Post date:** [May 2, 2014, 8:59pm UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/15 "2014-05-02T20:59:34Z")

</div>

I should admit I am not a Java developer by trade, so I'm trying pretty  
hard here.

When I call .registerRiver, I am passing the module, not the river.  
RiverImpl.Type is just the string "river".

public void onModule(RiversModule module) {  
module.registerRiver(RiverImpl.TYPE, ModuleImpl.class);  
}

If this isn't what you mean, please dial me in a bit more. Guice is a  
foreign to me too.

On Friday, May 2, 2014 12:34:47 PM UTC-5, Rob Ottaway wrote:

> Oh sorry module is fine, it's the call to module.registerRiver which is  
> being passed the River itself and not the River Guice module. Try that  
> change.
> 
> On Fri, May 2, 2014 at 10:33 AM, Rob Ottaway \<[robot...@gmail.com](mailto:robot...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I think he means in your Guice module. You are registering the WRONG  
> > thing 😉
> > 
> > On Fri, May 2, 2014 at 6:49 AM, Joshua Chan \<[joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)\<javascript:\>
> > 
> > > wrote:
> > 
> > > I've tried this too with no luck
> > > 
> > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > {  
> > > "type": "river",  
> > > "river":{  
> > > "blah":"blah"  
> > > }  
> > > }
> > > 
> > > On Friday, May 2, 2014 3:31:23 AM UTC-5, Luca Cavanna wrote:
> > > 
> > > > Hi Joshua,  
> > > > the package is not an issue if you are using the default one for your  
> > > > classes. Looking deeper, the type of the river that you try to register  
> > > > with your rest call doesn't match the type of the river you registered in  
> > > > the plugin when you did module.registerRiver(type, riverclass).
> > > > 
> > > > Cheers  
> > > > Luca
> > > > 
> > > > On Friday, May 2, 2014 6:08:28 AM UTC+2, Rob Ottaway wrote:
> > > > 
> > > > > I should have sent you the following earlier rather than a non-river  
> > > > > plugin:
> > > > > 
> > > > > the plugin:  
> > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java
> > > > > 
> > > > > The river implementation:  
> > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > elasticsearch/river/rabbitmq/RabbitmqRiver.java
> > > > > 
> > > > > The module:  
> > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > elasticsearch/river/rabbitmq/RabbitmqRiverModule.java
> > > > > 
> > > > > Looks like you are registering the river implementation rather than  
> > > > > the river module hence the not working. Had to look at an example I know  
> > > > > works to figure it out.
> > > > > 
> > > > > -Rob
> > > > > 
> > > > > On Thu, May 1, 2014 at 8:04 PM, Joshua Chan [joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)wrote:
> > > > > 
> > > > > > So, that's what I did, but no love... I checked in the latest.
> > > > > > 
> > > > > > -Josh
> > > > > > 
> > > > > > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > > > > > 
> > > > > > > Look at this plugin for help:
> > > > > > > 
> > > > > > > [GitHub - elastic/elasticsearch-cloud-aws: AWS Cloud Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-cloud-aws/)  
> > > > > > > blob/master/src/main/resources/es-plugin.properties
> > > > > > > 
> > > > > > > Yes it needs to be the FQN.
> > > > > > > 
> > > > > > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > > > > > 
> > > > > > > > Thanks Rob. Someone else also told me the plugin property should be  
> > > > > > > > the fully qualified name. I didn't declare a package, so I guess I'm using  
> > > > > > > > the default package, and I thought I had the namespacing right since  
> > > > > > > > IntelliJ corrected the class name when I wrote it.
> > > > > > > > 
> > > > > > > > Thoughts?
> > > > > > > > 
> > > > > > > > -Josh
> > > > > > > > 
> > > > > > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > > > > > 
> > > > > > > > > Look at this file in your BB repo:
> > > > > > > > > 
> > > > > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/fd23648c3)  
> > > > > > > > > e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-  
> > > > > > > > > plugin.properties?at=master
> > > > > > > > > 
> > > > > > > > > cheers
> > > > > > > > > 
> > > > > > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > > > > > 
> > > > > > > > > > This strikes me as odd:
> > > > > > > > > > 
> > > > > > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > > > > > 
> > > > > > > > > > Assume you didn't map the string example\_river to the actual  
> > > > > > > > > > class name properly?
> > > > > > > > > > 
> > > > > > > > > > -Rob
> > > > > > > > > > 
> > > > > > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > > > > > 
> > > > > > > > > > > I'm making my first go at writing a river. (Here's the source  
> > > > > > > > > > > code: [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > > > > > 
> > > > > > > > > > > I followed this tutorial  
> > > > > > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticse)  
> > > > > > > > > > > arch-river-plugin/
> > > > > > > > > > > 
> > > > > > > > > > > and compared it to this existing river  
> > > > > > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > > > > > 
> > > > > > > > > > > but I haven't had much luck.
> > > > > > > > > > > 
> > > > > > > > > > > To deploy the river, I created a folder called example-river  
> > > > > > > > > > > under plugins, dropped my jar in that folder, and restarted the node.  
> > > > > > > > > > > Everything starts up fine.
> > > > > > > > > > > 
> > > > > > > > > > > I have also tried bin/plugin --url file:///path/to/plugin  
> > > > > > > > > > > --install example-river, which seems to work, but it unpacks my  
> > > > > > > > > > > jar. So, I tried zipping it first and then installing, which works and does  
> > > > > > > > > > > not unpack my jar, but it didn't help.
> > > > > > > > > > > 
> > > > > > > > > > > When I issue this PUT request:
> > > > > > > > > > > 
> > > > > > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > > > > > {  
> > > > > > > > > > > "type": "example\_river",  
> > > > > > > > > > > "example\_river":{  
> > > > > > > > > > > "blah":"blah"  
> > > > > > > > > > > }  
> > > > > > > > > > > }
> > > > > > > > > > > 
> > > > > > > > > > > I get this exception:
> > > > > > > > > > > 
> > > > > > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > > > > > 
> > > > > > > > > > > Can someone point out what I am missing?
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > You received this message because you are subscribed to a topic in  
> > > > > > > > > > the Google Groups "elasticsearch" group.  
> > > > > > > > > > To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > > > > > topic/elasticsearch/kIlh\_0hm3no/unsubscribe.  
> > > > > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > > > > > msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%  
> > > > > > > > > > [40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > > > > .
> > > > > > 
> > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to a topic in the  
> > > > > Google Groups "elasticsearch" group.  
> > > > > To unsubscribe from this topic, visit  
> > > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe).  
> > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > > To view this discussion on the web visit  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/793bb137-ed0a-49f4-81ec-02a02f570135%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/793bb137-ed0a-49f4-81ec-02a02f570135%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rob\_Ottaway](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rob_ottaway/32/1597_2.png) [@Rob\_Ottaway](https://discuss.elastic.co/u/Rob_Ottaway)\
**Post date:** [May 4, 2014, 2:10am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/16 "2014-05-04T02:10:51Z")

</div>

Wow I am (mostly) a Java developer by trade and I really steered you wrong.  
Sorry! You are definitely registering the module, chock up my poor answer  
to a looong day at work.

I think far as I can see you have everything you need in place. You  
register the plugin as "river" and set the type in your REST POST to  
"river" which is right though Luca thinks otherwise. Maybe he knows  
something I don't, I'm not batting exactly 1000 here. Let me check your  
code out and install it locally, do a little dev QA.

-Rob

On Friday, May 2, 2014 1:59:34 PM UTC-7, Joshua Chan wrote:

> I should admit I am not a Java developer by trade, so I'm trying pretty  
> hard here.
> 
> When I call .registerRiver, I am passing the module, not the river.  
> RiverImpl.Type is just the string "river".
> 
> public void onModule(RiversModule module) {  
> module.registerRiver(RiverImpl.TYPE, ModuleImpl.class);  
> }
> 
> If this isn't what you mean, please dial me in a bit more. Guice is a  
> foreign to me too.
> 
> On Friday, May 2, 2014 12:34:47 PM UTC-5, Rob Ottaway wrote:
> 
> > Oh sorry module is fine, it's the call to module.registerRiver which is  
> > being passed the River itself and not the River Guice module. Try that  
> > change.
> > 
> > On Fri, May 2, 2014 at 10:33 AM, Rob Ottaway [robot...@gmail.com](mailto:robot...@gmail.com) wrote:
> > 
> > > I think he means in your Guice module. You are registering the WRONG  
> > > thing 😉
> > > 
> > > On Fri, May 2, 2014 at 6:49 AM, Joshua Chan [joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)wrote:
> > > 
> > > > I've tried this too with no luck
> > > > 
> > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > {  
> > > > "type": "river",  
> > > > "river":{  
> > > > "blah":"blah"  
> > > > }  
> > > > }
> > > > 
> > > > On Friday, May 2, 2014 3:31:23 AM UTC-5, Luca Cavanna wrote:
> > > > 
> > > > > Hi Joshua,  
> > > > > the package is not an issue if you are using the default one for your  
> > > > > classes. Looking deeper, the type of the river that you try to register  
> > > > > with your rest call doesn't match the type of the river you registered in  
> > > > > the plugin when you did module.registerRiver(type, riverclass).
> > > > > 
> > > > > Cheers  
> > > > > Luca
> > > > > 
> > > > > On Friday, May 2, 2014 6:08:28 AM UTC+2, Rob Ottaway wrote:
> > > > > 
> > > > > > I should have sent you the following earlier rather than a non-river  
> > > > > > plugin:
> > > > > > 
> > > > > > the plugin:  
> > > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > > elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java
> > > > > > 
> > > > > > The river implementation:  
> > > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > > elasticsearch/river/rabbitmq/RabbitmqRiver.java
> > > > > > 
> > > > > > The module:  
> > > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > > elasticsearch/river/rabbitmq/RabbitmqRiverModule.java
> > > > > > 
> > > > > > Looks like you are registering the river implementation rather than  
> > > > > > the river module hence the not working. Had to look at an example I know  
> > > > > > works to figure it out.
> > > > > > 
> > > > > > -Rob
> > > > > > 
> > > > > > On Thu, May 1, 2014 at 8:04 PM, Joshua Chan [joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)wrote:
> > > > > > 
> > > > > > > So, that's what I did, but no love... I checked in the latest.
> > > > > > > 
> > > > > > > -Josh
> > > > > > > 
> > > > > > > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > > > > > > 
> > > > > > > > Look at this plugin for help:
> > > > > > > > 
> > > > > > > > [GitHub - elastic/elasticsearch-cloud-aws: AWS Cloud Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-cloud-aws/)  
> > > > > > > > blob/master/src/main/resources/es-plugin.properties
> > > > > > > > 
> > > > > > > > Yes it needs to be the FQN.
> > > > > > > > 
> > > > > > > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > > > > > > 
> > > > > > > > > Thanks Rob. Someone else also told me the plugin property should  
> > > > > > > > > be the fully qualified name. I didn't declare a package, so I guess I'm  
> > > > > > > > > using the default package, and I thought I had the namespacing right since  
> > > > > > > > > IntelliJ corrected the class name when I wrote it.
> > > > > > > > > 
> > > > > > > > > Thoughts?
> > > > > > > > > 
> > > > > > > > > -Josh
> > > > > > > > > 
> > > > > > > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > > > > > > 
> > > > > > > > > > Look at this file in your BB repo:
> > > > > > > > > > 
> > > > > > > > > > [https://bitbucket.org/futurechan/example-river/src/fd23648c3](https://bitbucket.org/futurechan/example-river/src/fd23648c3)  
> > > > > > > > > > e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-  
> > > > > > > > > > plugin.properties?at=master
> > > > > > > > > > 
> > > > > > > > > > cheers
> > > > > > > > > > 
> > > > > > > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > > > > > > 
> > > > > > > > > > > This strikes me as odd:
> > > > > > > > > > > 
> > > > > > > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > > > > > > 
> > > > > > > > > > > Assume you didn't map the string example\_river to the actual  
> > > > > > > > > > > class name properly?
> > > > > > > > > > > 
> > > > > > > > > > > -Rob
> > > > > > > > > > > 
> > > > > > > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > > > > > > 
> > > > > > > > > > > > I'm making my first go at writing a river. (Here's the source  
> > > > > > > > > > > > code: [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > > > > > > 
> > > > > > > > > > > > I followed this tutorial  
> > > > > > > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticse)  
> > > > > > > > > > > > arch-river-plugin/
> > > > > > > > > > > > 
> > > > > > > > > > > > and compared it to this existing river  
> > > > > > > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > > > > > > 
> > > > > > > > > > > > but I haven't had much luck.
> > > > > > > > > > > > 
> > > > > > > > > > > > To deploy the river, I created a folder called example-river  
> > > > > > > > > > > > under plugins, dropped my jar in that folder, and restarted the node.  
> > > > > > > > > > > > Everything starts up fine.
> > > > > > > > > > > > 
> > > > > > > > > > > > I have also tried bin/plugin --url file:///path/to/plugin  
> > > > > > > > > > > > --install example-river, which seems to work, but it unpacks  
> > > > > > > > > > > > my jar. So, I tried zipping it first and then installing, which works and  
> > > > > > > > > > > > does not unpack my jar, but it didn't help.
> > > > > > > > > > > > 
> > > > > > > > > > > > When I issue this PUT request:
> > > > > > > > > > > > 
> > > > > > > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > > > > > > {  
> > > > > > > > > > > > "type": "example\_river",  
> > > > > > > > > > > > "example\_river":{  
> > > > > > > > > > > > "blah":"blah"  
> > > > > > > > > > > > }  
> > > > > > > > > > > > }
> > > > > > > > > > > > 
> > > > > > > > > > > > I get this exception:
> > > > > > > > > > > > 
> > > > > > > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > > > > > > 
> > > > > > > > > > > > Can someone point out what I am missing?
> > > > > > > > > > > 
> > > > > > > > > > > --  
> > > > > > > > > > > You received this message because you are subscribed to a topic in  
> > > > > > > > > > > the Google Groups "elasticsearch" group.  
> > > > > > > > > > > To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > > > > > > topic/elasticsearch/kIlh\_0hm3no/unsubscribe.  
> > > > > > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > > > > To view this discussion on the web visit  
> > > > > > > > > > > [https://groups.google.com/d/msgid/elasticsearch/09202b8e-](https://groups.google.com/d/msgid/elasticsearch/09202b8e-)  
> > > > > > > > > > > 5e77-4c51-b4b0-f47c0b0f5bc0%[40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > > > > > .
> > > > > > > 
> > > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to a topic in the  
> > > > > > Google Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this topic, visit  
> > > > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe)  
> > > > > > .  
> > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > To view this discussion on the web visit  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e073f7bd-9594-4e89-bc21-c4f093d73746%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e073f7bd-9594-4e89-bc21-c4f093d73746%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rob\_Ottaway](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rob_ottaway/32/1597_2.png) [@Rob\_Ottaway](https://discuss.elastic.co/u/Rob_Ottaway)\
**Post date:** [May 4, 2014, 2:47am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/17 "2014-05-04T02:47:00Z")

</div>

So I changed on minor thing, which was the package a zip assembly. I had  
failed to notice this until I checked out and built your project. I hadn't  
looked at the pom figuring it was a coding issue 🙂

You can find the code here:

[https://github.com/robottaway/simple-es-river](https://github.com/robottaway/simple-es-river)

Then I created the assembly using "mvn package", which put a zip file in  
./target/releases/example-river-1.0-SNAPSHOT.zip THAT IS WHAT YOU NEED TO  
MAKE THIS WORK.

I see what Luca was talking about, noticed you updated your REST example  
changing "example\_river" to "river".

Next I installed this in Elasticsearch 1.1.1 I have running local.

robs-mbp-3:elasticsearch-1.1.1 rob$ bin/plugin --url  
file:///Users/rob/development/git/example-river/target/releases/example-river-1.0-SNAPSHOT.zip  
--install blarggh  
-\> Installing blarggh...  
Trying  
file:/Users/rob/development/git/example-river/target/releases/example-river-1.0-SNAPSHOT.zip...  
Downloading  
................................................................................................................................................................DONE

Then

robs-mbp-3:elasticsearch-1.1.1 rob$ curl -X PUT -H "Content-Type:  
application/json" [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta) -d '{

> ```
> "type": "river",
> 
> ```
> 
> "river":{  
> "blah":"blah"  
> }  
> }'  
> {"\_index":"\_river","\_type":"example\_river","\_id":"\_meta","\_version":1,"created":true

as you can see works just fine. Hit me up if you have any trouble.

cheers,  
Rob

On Saturday, May 3, 2014 7:10:51 PM UTC-7, Rob Ottaway wrote:

> Wow I am (mostly) a Java developer by trade and I really steered you  
> wrong. Sorry! You are definitely registering the module, chock up my poor  
> answer to a looong day at work.
> 
> I think far as I can see you have everything you need in place. You  
> register the plugin as "river" and set the type in your REST POST to  
> "river" which is right though Luca thinks otherwise. Maybe he knows  
> something I don't, I'm not batting exactly 1000 here. Let me check your  
> code out and install it locally, do a little dev QA.
> 
> -Rob
> 
> On Friday, May 2, 2014 1:59:34 PM UTC-7, Joshua Chan wrote:
> 
> > I should admit I am not a Java developer by trade, so I'm trying pretty  
> > hard here.
> > 
> > When I call .registerRiver, I am passing the module, not the river.  
> > RiverImpl.Type is just the string "river".
> > 
> > public void onModule(RiversModule module) {  
> > module.registerRiver(RiverImpl.TYPE, ModuleImpl.class);  
> > }
> > 
> > If this isn't what you mean, please dial me in a bit more. Guice is a  
> > foreign to me too.
> > 
> > On Friday, May 2, 2014 12:34:47 PM UTC-5, Rob Ottaway wrote:
> > 
> > > Oh sorry module is fine, it's the call to module.registerRiver which is  
> > > being passed the River itself and not the River Guice module. Try that  
> > > change.
> > > 
> > > On Fri, May 2, 2014 at 10:33 AM, Rob Ottaway [robot...@gmail.com](mailto:robot...@gmail.com) wrote:
> > > 
> > > > I think he means in your Guice module. You are registering the WRONG  
> > > > thing 😉
> > > > 
> > > > On Fri, May 2, 2014 at 6:49 AM, Joshua Chan [joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)wrote:
> > > > 
> > > > > I've tried this too with no luck
> > > > > 
> > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > {  
> > > > > "type": "river",  
> > > > > "river":{  
> > > > > "blah":"blah"  
> > > > > }  
> > > > > }
> > > > > 
> > > > > On Friday, May 2, 2014 3:31:23 AM UTC-5, Luca Cavanna wrote:
> > > > > 
> > > > > > Hi Joshua,  
> > > > > > the package is not an issue if you are using the default one for your  
> > > > > > classes. Looking deeper, the type of the river that you try to register  
> > > > > > with your rest call doesn't match the type of the river you registered in  
> > > > > > the plugin when you did module.registerRiver(type, riverclass).
> > > > > > 
> > > > > > Cheers  
> > > > > > Luca
> > > > > > 
> > > > > > On Friday, May 2, 2014 6:08:28 AM UTC+2, Rob Ottaway wrote:
> > > > > > 
> > > > > > > I should have sent you the following earlier rather than a non-river  
> > > > > > > plugin:
> > > > > > > 
> > > > > > > the plugin:  
> > > > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > > > elasticsearch/plugin/river/rabbitmq/RabbitmqRiverPlugin.java
> > > > > > > 
> > > > > > > The river implementation:  
> > > > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > > > elasticsearch/river/rabbitmq/RabbitmqRiver.java
> > > > > > > 
> > > > > > > The module:  
> > > > > > > [https://github.com/elasticsearch/elasticsearch-](https://github.com/elasticsearch/elasticsearch-)  
> > > > > > > river-rabbitmq/blob/master/src/main/java/org/  
> > > > > > > elasticsearch/river/rabbitmq/RabbitmqRiverModule.java
> > > > > > > 
> > > > > > > Looks like you are registering the river implementation rather than  
> > > > > > > the river module hence the not working. Had to look at an example I know  
> > > > > > > works to figure it out.
> > > > > > > 
> > > > > > > -Rob
> > > > > > > 
> > > > > > > On Thu, May 1, 2014 at 8:04 PM, Joshua Chan [joshua.be...@gmail.com](mailto:joshua.be...@gmail.com)wrote:
> > > > > > > 
> > > > > > > > So, that's what I did, but no love... I checked in the latest.
> > > > > > > > 
> > > > > > > > -Josh
> > > > > > > > 
> > > > > > > > On Thursday, May 1, 2014 9:49:11 PM UTC-5, Rob Ottaway wrote:
> > > > > > > > 
> > > > > > > > > Look at this plugin for help:
> > > > > > > > > 
> > > > > > > > > [GitHub - elastic/elasticsearch-cloud-aws: AWS Cloud Plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-cloud-aws/)  
> > > > > > > > > blob/master/src/main/resources/es-plugin.properties
> > > > > > > > > 
> > > > > > > > > Yes it needs to be the FQN.
> > > > > > > > > 
> > > > > > > > > On Thursday, May 1, 2014 5:47:31 PM UTC-7, Joshua Chan wrote:
> > > > > > > > > 
> > > > > > > > > > Thanks Rob. Someone else also told me the plugin property should  
> > > > > > > > > > be the fully qualified name. I didn't declare a package, so I guess I'm  
> > > > > > > > > > using the default package, and I thought I had the namespacing right since  
> > > > > > > > > > IntelliJ corrected the class name when I wrote it.
> > > > > > > > > > 
> > > > > > > > > > Thoughts?
> > > > > > > > > > 
> > > > > > > > > > -Josh
> > > > > > > > > > 
> > > > > > > > > > On Thursday, May 1, 2014 5:23:25 PM UTC-5, Rob Ottaway wrote:
> > > > > > > > > > 
> > > > > > > > > > > Look at this file in your BB repo:
> > > > > > > > > > > 
> > > > > > > > > > > [Bitbucket](https://bitbucket.org/futurechan/example-river/src/fd23648c3)  
> > > > > > > > > > > e7cc42fd2286d4134e80ecd7e98f802/src/main/resources/es-  
> > > > > > > > > > > plugin.properties?at=master
> > > > > > > > > > > 
> > > > > > > > > > > cheers
> > > > > > > > > > > 
> > > > > > > > > > > On Thursday, May 1, 2014 3:21:59 PM UTC-7, Rob Ottaway wrote:
> > > > > > > > > > > 
> > > > > > > > > > > > This strikes me as odd:
> > > > > > > > > > > > 
> > > > > > > > > > > > java.lang.ClassNotFoundException: example\_river
> > > > > > > > > > > > 
> > > > > > > > > > > > Assume you didn't map the string example\_river to the actual  
> > > > > > > > > > > > class name properly?
> > > > > > > > > > > > 
> > > > > > > > > > > > -Rob
> > > > > > > > > > > > 
> > > > > > > > > > > > On Thursday, May 1, 2014 11:40:52 AM UTC-7, Joshua Chan wrote:
> > > > > > > > > > > > 
> > > > > > > > > > > > > I'm making my first go at writing a river. (Here's the source  
> > > > > > > > > > > > > code: [Bitbucket](https://bitbucket.org/futurechan/example-river/src))
> > > > > > > > > > > > > 
> > > > > > > > > > > > > I followed this tutorial  
> > > > > > > > > > > > > [Trifork Blog - Keep updated on the technical solutions Trifork is working on!](http://blog.trifork.com/2013/01/10/how-to-write-an-elasticse)  
> > > > > > > > > > > > > arch-river-plugin/
> > > > > > > > > > > > > 
> > > > > > > > > > > > > and compared it to this existing river  
> > > > > > > > > > > > > [GitHub - jprante/elasticsearch-jdbc: JDBC importer for Elasticsearch](https://github.com/jprante/elasticsearch-river-jdbc)
> > > > > > > > > > > > > 
> > > > > > > > > > > > > but I haven't had much luck.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > To deploy the river, I created a folder called example-river  
> > > > > > > > > > > > > under plugins, dropped my jar in that folder, and restarted the node.  
> > > > > > > > > > > > > Everything starts up fine.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > I have also tried bin/plugin --url file:///path/to/plugin  
> > > > > > > > > > > > > --install example-river, which seems to work, but it unpacks  
> > > > > > > > > > > > > my jar. So, I tried zipping it first and then installing, which works and  
> > > > > > > > > > > > > does not unpack my jar, but it didn't help.
> > > > > > > > > > > > > 
> > > > > > > > > > > > > When I issue this PUT request:
> > > > > > > > > > > > > 
> > > > > > > > > > > > > [http://localhost:9200/\_river/example\_river/\_meta](http://localhost:9200/_river/example_river/_meta)  
> > > > > > > > > > > > > {  
> > > > > > > > > > > > > "type": "example\_river",  
> > > > > > > > > > > > > "example\_river":{  
> > > > > > > > > > > > > "blah":"blah"  
> > > > > > > > > > > > > }  
> > > > > > > > > > > > > }
> > > > > > > > > > > > > 
> > > > > > > > > > > > > I get this exception:
> > > > > > > > > > > > > 
> > > > > > > > > > > > > [2014-04-20 22:28:46,538][DEBUG][river] [Gloom] creating river [example\_river][example\_river]  
> > > > > > > > > > > > > [2014-04-20 22:28:46,543][WARN][river] [Gloom] failed to create river [example\_river][example\_river] org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [example\_river] at  
> > > > > > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:87) at  
> > > > > > > > > > > > > org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:58) at  
> > > > > > > > > > > > > org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at  
> > > > > > > > > > > > > org.elasticsearch.river.RiversService.createRiver(RiversService.java:137) at  
> > > > > > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:275) at  
> > > > > > > > > > > > > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:269) at  
> > > > > > > > > > > > > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.jav  
> > > > > > > > > > > > > a:93) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at  
> > > > > > > > > > > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at  
> > > > > > > > > > > > > java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: example\_river at java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > > > > > java.net.URLClassLoader$1.run(Unknown Source) at  
> > > > > > > > > > > > > java.security.AccessController.doPrivileged(Native Method) 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) at  
> > > > > > > > > > > > > org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:73) ... 9 more
> > > > > > > > > > > > > 
> > > > > > > > > > > > > Can someone point out what I am missing?
> > > > > > > > > > > > 
> > > > > > > > > > > > --  
> > > > > > > > > > > > You received this message because you are subscribed to a topic in  
> > > > > > > > > > > > the Google Groups "elasticsearch" group.  
> > > > > > > > > > > > To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > > > > > > > topic/elasticsearch/kIlh\_0hm3no/unsubscribe.  
> > > > > > > > > > > > To unsubscribe from this group and all its topics, send an email  
> > > > > > > > > > > > to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > > > > > To view this discussion on the web visit  
> > > > > > > > > > > > [https://groups.google.com/d/msgid/elasticsearch/09202b8e-](https://groups.google.com/d/msgid/elasticsearch/09202b8e-)  
> > > > > > > > > > > > 5e77-4c51-b4b0-f47c0b0f5bc0%[40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > > > > > > .
> > > > > > > > 
> > > > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > > > > 
> > > > > > > --  
> > > > > > > You received this message because you are subscribed to a topic in the  
> > > > > > > Google Groups "elasticsearch" group.  
> > > > > > > To unsubscribe from this topic, visit  
> > > > > > > [https://groups.google.com/d/topic/elasticsearch/kIlh\_0hm3no/unsubscribe](https://groups.google.com/d/topic/elasticsearch/kIlh_0hm3no/unsubscribe)  
> > > > > > > .  
> > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > To view this discussion on the web visit  
> > > > > > > [https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/485c6794-d7e2-4f42-9a12-bdc7f584ad9e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > .
> > > > > 
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d4532b52-133b-4500-8f03-a3f0682f1039%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d4532b52-133b-4500-8f03-a3f0682f1039%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:31am UTC](https://discuss.elastic.co/t/how-to-write-a-custom-river/17305/18 "2017-07-06T01:31:56Z")

</div>


