jprante / elasticsearch-jdbc

JDBC importer for Elasticsearch
Apache License 2.0
2.84k stars 710 forks source link

- IncompatibleClassChangeError[Implementing class] #397

Open eyjolfur12 opened 9 years ago

eyjolfur12 commented 9 years ago

Hi Jörge.

And thanks for this great software!

I have been running an elasticsearch server for some time, using version 1.1.1 with river-jdbc 1.1.0.0.

Now I am setting up another one, with elasticsearch 1.4.0 and the newest version of river-jdbc, but when I have installed the plugin, elastisearch will not load with the error:

[2014-11-26 23:42:07,266][INFO ][node ] [Shang-Chi] version[1.4.0], pid[12239], build[bc94bd8/2014-11-05T14:26:12Z] [2014-11-26 23:42:07,267][INFO ][node ] [Shang-Chi] initializing ... [2014-11-26 23:42:07,338][INFO ][plugins ] [Shang-Chi] loaded [jdbc-1.3.4.4-d2e33c3], sites [HQ] [2014-11-26 23:42:07,438][ERROR][bootstrap ] {1.4.0}: Initialization Failed ...

  • IncompatibleClassChangeError[Implementing class]

Some googling indicated that this was related to conflicting class definitions in different jar's and suggested setting up "correct" classpath. I am not en experienced java programmer, but tried set the classpath so:

$ echo $CLASSPATH :/usr/share/elasticsearch/lib:/usr/share/elasticsearch/bin:/usr/share/elasticsearch/plugins/jdbc

But that did not change anything. I also, per your suggestion in another issue here, changed the owner of the plugin folder to elasticsearch, and I notice that in the init.d script that I use to start the service the $ES_USER is made the owner of the working, data and log dirs.

I also tried downgrading to river-jdbc 1.3.4.3 and postgres-9-3-1101.jdbc41, but got the same error.

I would greatly appreciate any help on this

Eyjólfur Kristjánsson

Below are some possibly relevant info:

Java:

java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Plugin dir:

-rw-r--r-- 1 root root 283345 nóv 26 21:38 elasticsearch-river-jdbc-1.3.4.4.jar -rw-r--r-- 1 elasticsearch root 380 nóv 26 21:59 log4j2.xml -rw-r--r-- 1 elasticsearch root 234 nóv 26 21:59 log4j.properties -rw-r--r-- 1 elasticsearch root 588901 feb 19 2014 postgresql-9.3-1102.jdbc41.jar

Full trace:

{1.4.0}: Initialization Failed ...

  • IncompatibleClassChangeError[Implementing class] java.lang.IncompatibleClassChangeError: Implementing class at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:455) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:367) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2663) at java.lang.Class.getConstructor0(Class.java:3067) at java.lang.Class.getConstructor(Class.java:1817) at org.elasticsearch.common.inject.Modules.createModule(Modules.java:40) at org.elasticsearch.plugins.PluginsModule.spawnModules(PluginsModule.java:53) at org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44) at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:167) at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159) at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:70) at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:203) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
jprante commented 9 years ago

You are running a JDBC river 1.3.x against Elasticsearch 1.4.x, this is incompatible.

eyjolfur12 commented 9 years ago

Thank you Jörge, for taking the time to look at this. I appreciate it.

I had at least convinced myself, that I had started out by installing version 1.4 of river-jdbc and then downgraded to 1.3.4.3, but I must have been mistaken and maybe started out with 1.3.4.4. At least it is seems to be running fine now with 1.4.0.3.Beta1. Sorry for wasting your time.

eliasah commented 9 years ago

I have also an issue after upgrading as well. Elasticsearch doesn't seem to find the mysql driver. I have copied the driver in the plugins/river-jdbc directory and also in lib. I've restarted elasticsearch and I still get this error

[2014-12-09 17:41:39,910][ERROR][river.jdbc.SimpleRiverSource] while opening read connection:     jdbc:mysql://localhost:3306/products_fr No suitable driver found for     jdbc:mysql://localhost:3306/products_fr
java.sql.SQLException: No suitable driver found for jdbc:mysql://[myhost]:3306/products_fr
        at java.sql.DriverManager.getConnection(DriverManager.java:596)
        at java.sql.DriverManager.getConnection(DriverManager.java:187)
        at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.getConnectionForReading(SimpleRiverSource.java:217)
        at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.execute(SimpleRiverSource.java:376)
        at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:320)
        at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.fetch(SimpleRiverFlow.java:209)
        at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverFlow.execute(SimpleRiverFlow.java:139)
        at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.request(RiverPipeline.java:88)
        at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:66)
        at org.xbib.elasticsearch.plugin.jdbc.RiverPipeline.call(RiverPipeline.java:30)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

Where should I put the jdbc driver jar?

Thanks in advance! :)

adamvoss commented 9 years ago

@eliasah Hopefully someone finds your question here. Since it is not directly related to the original issue here, you might consider creating your own issue. I did not do an upgrade, but the jdbc plugin installed for me to 'plugins/jdbc' rather than 'plugins/river-jbdc' placing my driver in the jdbc folder worked for me.

adamvoss commented 9 years ago

If the original issue is reported reported enough, you might consider changing the main page to make more explicit the need to pay attention to version.

I am setting up a new box and encountered this because I just blindly followed the Installation command and then the error brought me here.

ghost commented 9 years ago

Any plan to release a final version compatible with ES 1.4 ?

jprante commented 9 years ago

There is version 1.4.0.3, this is compatible with ES 1.4

xiaohelong commented 9 years ago

@jprante,thanks ,it solved my problem