[resolved] MySQL "Enable stream" option generates java.lang.IncompatibleClassChan

[resolved] MySQL "Enable stream" option generates java.lang.IncompatibleClassChan

Hello,
I made several jobs on my local machine and built them. Some of them have tMysqlInput Components with the option "Enable stream". When I run the built job on my local machine, it works fine. When I try to run the same jobs on a test environment, I get this error when executing the tMysqlInput with the enable stream option option :
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface com.mysql.jdbc.Statement, but class was expected
My local environment settings :
Mysql : /Applications/MAMP/Library/bin/mysql Ver 14.14 Distrib 5.5.33, for osx10.6 (i386) using EditLine wrapper
Java : java version "1.7.0_51"
My test environment settings :
Mysql : mysql Ver 14.14 Distrib 5.5.21, for Linux (x86_64) using readline 5.1
Java : java version "1.6.0"
In TOS, I set the JDK compliance so that it uses the 1.6 level but it's not working.
I really need to use the "Enable stream" option here, any idea of how I can make it work ?
Thanks.

Accepted Solutions
Seventeen Stars

Re: [resolved] MySQL "Enable stream" option generates java.lang.IncompatibleClassChan

Your solution is Ok and to be honest I have done similar things.
This problem is not a problem caused by Talend instead it is a problem caused by Oracle.

All Replies
Seventeen Stars

Re: [resolved] MySQL "Enable stream" option generates java.lang.IncompatibleClassChan

I understand you build the job on your Mac and move the artifact to the linux machine ?
I guess the problem is the JDBC driver. Di you use the same driver on both systems or on every system the specific driver?

Re: [resolved] MySQL "Enable stream" option generates java.lang.IncompatibleClassChan

Thank you jiolling for your help.
Yes I build the job on my Mac and move it to the linux machine.
Is there a way to build the jobs on the linux machine without having to install Talend ?
I actually found a solution but I'm not sure if it's ideal.
The problem occurs when I'm using the component tMysqlInput with the option "Enable stream". This component by default uses the driver mysql-connector-java-5.1.22-bin.jar.
So I modified the file /TOS_DI-r111943-V5.4.1 2/plugins/org.talend.designer.components.localprovider_5.4.1.r111943/components/tMysqlInput/tMysqlInput_java.xml and I replaced the line
<IMPORT NAME="Mysql_Driver5" MODULE="mysql-connector-java-5.1.22-bin.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.mysql/lib/mysql-connector-java-5.1.22-bin.jar" REQUIRED_IF="(DB_VERSION == 'MYSQL_5') AND (USE_EXISTING_CONNECTION == 'false')" />
by this one
<IMPORT NAME="Mysql_Driver5" MODULE="mysql-connector-java-5.0.8-bin.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.mysql/lib/mysql-connector-java-5.0.8-bin.jar" REQUIRED_IF="(DB_VERSION == 'MYSQL_5') AND (USE_EXISTING_CONNECTION == 'false')" />
Then I added the driver mysql-connector-java-5.0.8-bin.jar to my modules, I rebuilt the job and now it's working on my linux machine.
What do you think of this solution ? This is not clean at all.
Seventeen Stars

Re: [resolved] MySQL "Enable stream" option generates java.lang.IncompatibleClassChan

Your solution is Ok and to be honest I have done similar things.
This problem is not a problem caused by Talend instead it is a problem caused by Oracle.

Re: [resolved] MySQL "Enable stream" option generates java.lang.IncompatibleClassChan

Alright, thank you.
I guess I'll use this solution but that doesn't make me feel confident about the reliability of the interactions Talend/Mysql.