Start a new topic

SQL Error:java.lang.ClassNotFoundException

I'm attempting to test a workflow where the SQL task queries for a result, creates a file, encrypts the file, and then sends the file up to an SFTP server.  So far I haven't gotten past the SQL task.

I have downloaded the ./mysql-connector-java-5.0.8-bin.jar to the CrushFTP app directory.  The DB Driver defaults to, but when that didn't work I have modified it to com.mysql.jdbc.Driver.  When I Test DB Settings I get the error:

Error:java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Am I missing something?

Best Answer

Issue was related to a bug in the particular MySQL driver version being used, using a new versions resolved the issue.

The task config allows you to specify where the jar file is at.  You need to do that as its not loading the jar to find the driver file.



Looks like that was the problem, though the relative path looked correct and the jar was in the right location at the root of the application directory.  I also browsed to the jar in the GUI, but when I tried that again I realized it prepended a period to the absolute path, so I removed that and it is now locating the jar file.   

Screenshot is of how it was setup using a relative path and the location of the jar file.

(97.9 KB)

I don't know if a relative path is OK as I think that parameter is using URL type connection which always ends an absolute path.

OK - that makes sense.  Q: Am I not using the SQL task for what it is intended?  I want to select records from a table and then output those to a file.  My SQL task is connecting now and the log says it is looping through query results, but the task itself doesn't seem to return a success or failure and nothing then goes to the next task (which is a writefile task).  I'm wondering if this type of job will work at all.

Log from Completed Job:

06/26/2015 14:32:02.584:tasks.Task.:CrushTask items size=0

06/26/2015 14:32:02.587:tasks.SQLTask.SQL:Starting...

06/26/2015 14:32:02.616:tasks.SQLTask.SQL:Executing SQL:select * from mothership.logs limit 10;

06/26/2015 14:32:02.624:tasks.SQLTask.SQL:Looping through query results...

This means its still working on it...  Is it a simple quick query?

Yup - should take < 1 sec.  It is just a select query and is even limited to 10 rows:

select * from mothership.logs limit 10;

Also - the job status says completed.

I would try without the limit 10 on it.....

The SQL task didn't find any results, that is why there is nothing else in the log.

Yeah - I did.  I tried another table (smaller) and just did a select *.  it should have returned 52 rows, but has the same behavior.  I can test it live with you if you like.

Reply back on the ticket we have open with you please and we will continue there.


Issue was related to a bug in the particular MySQL driver version being used, using a new versions resolved the issue.

Login to post a comment