One Star

Class not found error trying to connect to MSSQL instance

I'm getting this error when trying to enter new connection data. I assume I am supposed to download it, but where do I put it? I tried the %CLASS_PATH% directory, no luck.
Thanks in advance.
Connection failure. You must change the Database Settings.
java.lang.RuntimeException: java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.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:608)
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: net.sourceforge.jtds.jdbc.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
14 REPLIES
Moderator

Re: Class not found error trying to connect to MSSQL instance

Hi,
Is there any red error indicator appears on the component(A error info shows:external modules are required for that component to work)?
What's the talend studio build version are you using?
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: Class not found error trying to connect to MSSQL instance

Hi ,
My version is 5.4.
let me know what is this issue.
Thanks.
Moderator

Re: Class not found error trying to connect to MSSQL instance

Hi,
I have made a testing in Talend Open Studio of Data Integration 5.4. Everything is OK.
Have you checked the documents TalendHelpCenter:Identify required external modules and TalendHelpCenter: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: Class not found error trying to connect to MSSQL instance

Hi Sabrina,
I am using Talend 5.6 and am trying to create a connection to a MS SQL DB in metadata.
I have copied the jtds-1.3.1.jar to <TALENDHOME>\configuration\java directory.
I have also copied the ntlmauth.dll file to C:\Windows\system32 and to C:\Program Files\Java\jdk\jre\bin directories.
However when I try to check the connection, I get the same error as described by Don in the first post.
Can you help me resolve this problem?
Regards,
Ketan
Moderator

Re: Class not found error trying to connect to MSSQL instance

Hi Ketan,
First of all, can you successfully connect to your MSSQL DB through client without using Talend Tool?
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.
Seven Stars

Re: Class not found error trying to connect to MSSQL instance

Hi,
I am able to connect to the DB server through MS SQL client.
I am also able to connect through Talend 6.1 after copying the ntlmauth.dll file to windows\system32 and jdk\jre\bin directories.
I think the problem with Talend 5.6 is that it is not able to detect the DB Driver class to connect to the server.
Regards,
Ketan
Moderator

Re: Class not found error trying to connect to MSSQL instance

Hi,
For the studio 5.6, could you place jtds-1.3.1.jar to<StudioPath>/lib/java to see if it works?
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.
Seven Stars

Re: Class not found error trying to connect to MSSQL instance

Hi Sabrina,
In Talend 5.6, by default, an external JAR gets copied into the <StudioPath>/configuration/lib/java directory.
I copied the jtds-1.3.1.jar to the same directory and restarted TOS.
But it is not getting detected. TOS is asking me to download jtds-1.2.5.jar.
And after I download the jar, I get the ClassNotFoundException.
Note I am using the TOS_DI-win-x86_64.exe to start studio.
Any solution to this particular problem?
Moderator

Re: Class not found error trying to connect to MSSQL instance

Hi,
Are you using 64 bit OS?
could you place jtds-1.3.1.jar to<StudioPath>/lib/java to see if it works? Talend-Studio-win32-x86 is for 32 bit and TOS_DI-win-x86_64.exe is for 64 bit OS.
Have you tried to place jtds-1.3.1.jar to<StudioPath>/lib/java to see if it is fixed?
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.
Seven Stars

Re: Class not found error trying to connect to MSSQL instance

Yes, I am using 64-bit Windows 8 OS.
As suggested I moved the jtds-1.3.1.jar file from <StudioPath>/configuration/lib/java to <StudioPath>/lib/java.
Then when I started TOS and tried to create a connection, the studio asked me to download the jtds-1.2.5 jar, which it placed in the <StudioPath>/configuration/lib/path directory.
And then I got the same exception. So your solution to place the JAR file in <StudioPath>/lib/java did not work.
Any other solution?
Moderator

Re: Class not found error trying to connect to MSSQL instance

Hi,
Then when I started TOS and tried to create a connection, the studio asked me to download the jtds-1.2.5 jar, which it placed in the <StudioPath>/configuration/lib/path directory.

Did you go to  Window-->Show View-->Talend-->Modules to see if your jtds-1.2.5 jar is installed? If not, could you please try to install it into studio by manul?
Have you already tried to use studio 6.1.1 to see if this issue repro?
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.
Seven Stars

Re: Class not found error trying to connect to MSSQL instance

I have tried with Studio 6.2 and the problem is not reproduced.
I checked the module/JAR is already installed, check the screenshot I have attached.
I also tried installing manually by selecting the jtds-1.3.1.jar file but the modules list has not got updated.
Moderator

Re: Class not found error trying to connect to MSSQL instance

Hi,
We can not repro your issue on V 5.6.2.
Is it Ok with you when you using 6.2.0M1? Could you please try to copy jtds-1.2.5 jar into  <StudioPath>/lib/java also to see if it works?
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.
Seven Stars

Re: Class not found error trying to connect to MSSQL instance

As you are not able to reproduce this issue and the higher versions do not face the same issue, I will consider this issue as resolved.