Re: How to write a custom river
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().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 The river implementation: 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 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.comwrote: 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 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/ 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: https://bitbucket.org/futurechan/example-river/src) I followed this tutorial http://blog.trifork.com/2013/01/10/how-to-write-an- elasticsearch-river-plugin/ and compared it to this existing river 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
How to write a custom river
I'm making my first go at writing a river. (Here's the source code: https://bitbucket.org/futurechan/example-river/src) I followed this tutorial http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/ and compared it to this existing river 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 { 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/938bb394-f7b3-4a96-8618-7f4ed075f0ed%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to write a custom river
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/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: https://bitbucket.org/futurechan/example-river/src) I followed this tutorial http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/ and compared it to this existing river 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 { 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/bd4a93ce-aa22-4da7-b7ad-34a451254955%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to write a custom river
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: 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: https://bitbucket.org/futurechan/example-river/src) I followed this tutorial http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/ and compared it to this existing river 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 { 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a29bcb00-b537-4e37-9387-f278b3dec157%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to write a custom river
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 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/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: https://bitbucket.org/futurechan/example-river/src) I followed this tutorial http://blog.trifork.com/2013/01/10/how-to-write-an-elasticsearch-river-plugin/ and compared it to this existing river 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 { 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/09202b8e-5e77-4c51-b4b0-f47c0b0f5bc0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.