TOS 5.1 MySql Connection Error

One Star

TOS 5.1 MySql Connection Error

Hi guys! I just installed TOS 5.1 over Linux Ubuntu and it run with no problem, but once i try to execute the Connection Job sample i am facing an error that follow below:

Starting job Connection at 23:28 20/05/2012.
connecting to socket on port 3538
connected
Exception in component tMysqlConnection_1
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at demojava.connection_0_1.Connection.tMysqlConnection_1Process(Connection.java:339)
at demojava.connection_0_1.Connection.runJobInTOS(Connection.java:1199)
at demojava.connection_0_1.Connection.main(Connection.java:1067)
disconnected
Job Connection ended at 23:28 20/05/2012.

For org.gjt.mm.mysql.Driver, i already did the download from www.jarfinder.com and put it over classpath variables.. but no way to works, may could someone give some hint how to solve this issue?

Note: My first install was under /opt/ directory and for testing i change it to /home/user/

Best regards,

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Hi
Welcome to Talend Community!
The mysql-connector-java-5.1.0-bin.jar file should be in TOS Installation directory.
Unarchive the installation file with 7-zip and try again.
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Hi Pedro, thanks for reply!

So, i did what you said but the error remains, i put the jar file under /home/myuser/TOS_BD-r82787-V5.1.0/ but doens't works.. may have you another hint?

Thanks again,

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Hi
Got you.
You are using TOS_BD-r82787-V5.1.0.
Now the workaround is if you have other versions of TOS, just copy this jar file into <TOS for BD installation dir>\lib.
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Okay Pedro, are suggesting to me for migrate to and older version, am i right?

If yes, what stable version should i install?

Just in addition for this one i already put the jar file under lib/java/ directory and doens't works also.

Regards,

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Hi
Maybe you can download Talend Open Studio for Data Integartion. What you are using now is TOS for Big Data.
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Hi Pedro, good news!

Now the connection works properly. Thank u!

Just a single question r u from Brasil?

Regards,

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Hi
Great! Glad to hear that. Smiley Happy
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Hi All
Root Reason: TOS for BD is released under Apache license.
All Libraries non compatible with Apache license must be added manually to the module view.
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Pedro, thanks for your last post. But the question is where can i find this module view?

May could you explain to us?

Regards,

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Hi
Add jar file as the following image.
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Hi friends, please someone knows how to use ignoreCase() native from Java?

For example i have a snipet of code like this under my expression filter row1.City.equals("Ohio") and i need to implement the ignore case, please could someone give a hint?

Best regards,

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Hi Sandro
You might use the expression as seen below.
row1.City.equalsIgnoreCase("Ohio")
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Hi Pedro!!! Thank you so much once again!

For I am facing one more newbie problem, the question is I have created a var Address composed by metadatas:
row3.TP_LOGR+ row3.LOGRADOURO+ row3.NUMERO+ row3.COMPLEMENTO

Which generates to me lines like that:
nullSTREET SHINE410null

I would like your hint to apply a condition for null values became '' and how to implement `, ` between Street and Numbering. This the output will produce for us STREET SHINE, 410

I already try a lot of kinds of code lines like this:

if(row3.TP_LOGR.equals(null)) {
row3.TP_LOGR = "";
}
if(row3.COMPLEMENTO.equals(null)) {
row3.COMPLEMENTO = "";
}
row3.TP_LOGR+ row3.LOGRADOURO+ row3.NUMERO+ row3.COMPLEMENTO

But nothing works properly, may could help-me, supply some link or material... I really need your help once again.

Kind regards,

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Hi Sandro
Try this.
if(row3.TP_LOGR==null) {
row3.TP_LOGR = "";
}
if(row3.COMPLEMENTO==null) {
row3.COMPLEMENTO = "";
}
row3.TP_LOGR+ row3.LOGRADOURO+ row3.NUMERO+ row3.COMPLEMENTO
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Pedro, I did what you said and now we are facing one Syntax Error concerning + over last line

row3.TP_LOGR+ row3.LOGRADOURO+ row3.NUMERO+ row3.COMPLEMENTO

I will try to upload an image.



Best regards,

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Hi
Try this expression.
row3.TP_LOGR==null?"":row3.TP_LOGR+ row3.LOGRADOURO+ row3.NUMERO+ row3.COMPLEMENTO==null?"":row3.COMPLEMENTO
Regards,
Pedro
One Star

Re: TOS 5.1 MySql Connection Error

Hi Pedro, this last one works to remove just the first one null value, for the last parameter it remains there... I try to treat it as a string comparison, but have a mismatch of types String to Boolean..

Kind regards over your friendship and guidance!

Sandro Regis
One Star

Re: TOS 5.1 MySql Connection Error

Pedro, I forgot to share the result with... I means for some single reason, once i reload the IDE the data filter works fine.

Thank you so much friend!

By the way I was thinking in contribute creating one video of all my tasks solved with your guidance, have we some place to post here in forum?

Tks again! God bless you!
One Star

Re: TOS 5.1 MySql Connection Error

Hi Sandro
Great! Thanks for your feedback.
You might upload your Talend jobs into Talend Exchange(Category:JOB) .
Regards,
Pedro