[resolved] Getting an Error Classnotfound Exception

One Star

[resolved] Getting an Error Classnotfound Exception

Hi All,
I have to connect to Mysql database i have done the connection in metadata.
but when i try to retrieve the schema i get an error.
I took tmysqlinput and wrote select * from table_name query and click on guess schema option it is showing me an error like :
java.lang.classnotfoundexception org.gjt.mm.mysql.driver
please suggest me what to do.
Thanking you,
with regards,
Akash S.
Seventeen Stars

Re: [resolved] Getting an Error Classnotfound Exception

Read the .... manual!
The Talend studio release starting with 5.3.1 does not ship the Open Source database drivers. You have to load the -so called modules - by your self. There are a convenient dialog in the Module view.
The driver must be find its way to <studio>/lib/java dir.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

Hello Sir,
Thank you for your valuable response and time .
If i understood you correctly so I need to install the driver for the same.. right ..?
and which are the drivers that i need to install to run this and from where should i get those drivers .
Thanks in Advance.
with kind regards,
Akash S.
Moderator

Re: [resolved] Getting an Error Classnotfound Exception

Hi,
Please refer to online document Identify required external modules and Install external modules.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

Hello xdshi,
Thank you for your help It is working fine now .
with kind regards,
Akash S.
Moderator

Re: [resolved] Getting an Error Classnotfound Exception

Hi,
Thanks for your feedback, don't hesitate to post your issue on forum.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

hi xdshi,
I am facing the same issue even after installing the modules.
below is the error.
Connection failure. You must change the Database Settings.
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at org.talend.core.model.metadata.builder.database.JDBCDriverLoader.getConnection(JDBCDriverLoader.java:179)
at org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils.connect(ExtractMetaDataUtils.java:1034)
at org.talend.core.model.metadata.builder.database.ExtractMetaDataFromDataBase.testConnection(ExtractMetaDataFromDataBase.java:300)
at org.talend.repository.ui.utils.ManagerConnection.check(ManagerConnection.java:293)
at org.talend.repository.ui.wizards.metadata.connection.database.DatabaseForm.checkConnection(DatabaseForm.java:2008)
at org.talend.repository.ui.wizards.metadata.connection.database.DatabaseForm.access$39(DatabaseForm.java:1933)
at org.talend.repository.ui.wizards.metadata.connection.database.DatabaseForm$23.widgetSelected(DatabaseForm.java:2261)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.talend.repository.ui.actions.metadata.CreateConnectionAction.doRun(CreateConnectionAction.java:207)
at org.talend.repository.ui.actions.AContextualAction$2.run(AContextualAction.java:611)
at org.talend.repository.RepositoryWorkUnit.executeRun(RepositoryWorkUnit.java:93)
at org.talend.core.repository.model.AbstractRepositoryFactory.executeRepositoryWorkUnit(AbstractRepositoryFactory.java:237)
at org.talend.repository.localprovider.model.LocalRepositoryFactory.executeRepositoryWorkUnit(LocalRepositoryFactory.java:3197)
at org.talend.core.repository.model.ProxyRepositoryFactory.executeRepositoryWorkUnit(ProxyRepositoryFactory.java:1979)
at org.talend.repository.ui.actions.AContextualAction.run(AContextualAction.java:617)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.talend.rcp.intro.Application.start(Application.java:145)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
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 java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.talend.core.model.metadata.builder.database.JDBCDriverLoader.getConnection(JDBCDriverLoader.java:129)
... 48 more
Moderator

Re: [resolved] Getting an Error Classnotfound Exception

Hi scmalshah,
What build version you're using? Did you get this exception when set up MySql DB connection?
Have you checked document TalendHelpCenter:Configuring Talend Studio as I mentioned in previous post?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

Hi i am getting error while running jsp program, can any one help pls...
error connecting driver: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
Four Stars

Re: [resolved] Getting an Error Classnotfound Exception

In / using Talend???? This is jar not found error... MySQL driver is not accessible to your code
Vaibhav
One Star

Re: [resolved] Getting an Error Classnotfound Exception

thanks vaibhav, i have to use updated jar files????
Moderator

Re: [resolved] Getting an Error Classnotfound Exception

Hi sharath,
If you are using talend studio, try to take the JDBC driver from the MySQL server installation and place the jar file in the lib <studio>/lib/java/ and it should work.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

Try to download 'mysql-connector-java-5.1.30-bin.jar' file. May be you will get 'mysql-connector-java-5.1.30.jar' file. Please rename the file and add '-bin' before the '.' in the file name.
This is an error in Talend (TOS_BD-r118616-V5.5.1) Mysql component.
This solved my problem.
Suggestion for Talend team : If you hard-code the class name 'org.gjt.mm.mysql.Driver' inside the generated code, then you need to provide the Jar file. Other wise you should provide a feature by which the user can enter the class name.  
Cheers,
Moderator

Re: [resolved] Getting an Error Classnotfound Exception

Hi OldUser,
Suggestion for Talend team : If you hard-code the class name 'org.gjt.mm.mysql.Driver' inside the generated code, then you need to provide the Jar file. Other wise you should provide a feature by which the user can enter the class name.  


Could you please open a workitem jira issue of DI project on Talend Bug Tracker? Our developer will check it.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

Hello xdshi,
For the following exception, could you please provide a solution? Please execute a job using the component and hope you will also get the same exception. 
"Exception in component tSqoopExport_1
java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
"
Please note the 'mysql-connector-java-5.1.30-bin.jar' file is already there in the lib/java folder and the component is throwing this exception.
Cheers,
Moderator

Re: [resolved] Getting an Error Classnotfound Exception

Hi,
Are you using Talend Open Studio Big Data 5.5.1?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

I'm having a similar issue but in the TAC AMC. The studio AMC perspective ha no problem though. I also see that the driver is in all the expected locations. When I use the AMC in the TAC and setup a connection to a repository, it won't connect. Instead I get "Unable to instantiate driver 'org.gjt.mm.mysql.Driver'" in the stack trace of tomcat. I did read the manual so I thought I had followed all of the steps. Everything else connects to MySQL just fine.
Moderator

Re: [resolved] Getting an Error Classnotfound Exception

Hi mayerA,
Have you already  placed the downloaded modules (JDBC driver) must in the following folder for Talend Administration Center
<TomcatPath>/webapps/org.talend.administrator/WEB-INF/lib ?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

Yes I have. That was one of the first things I did.
mysql-connector-java-5.1.22-bin
org.gjt.mm.mysql.Driver must be in:
C:\Talend\Install_5.6.2\tac\apache-tomcat\lib
C:\Talend\Install_5.6.2\tac\apache-tomcat\webapps\org.talend.administrator\WEB-INF\lib
Moderator

Re: [resolved] Getting an Error Classnotfound Exception

Hi mayerA,
Are you using Talend Suscription product? Have you already reported a ticket on Talend Support Portal? In this way, we can give you a remote assistance on your issue.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Getting an Error Classnotfound Exception

I have a Subscription version of Talend for Data Integration version 5.6.2. I will open a ticket.