Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
cleanServiceBuilder fails
I have a module project generated by Liferay IDE service builder. When I run the cleanServiceBuilder gradle task I get this error :
:modules:SeqPool:SeqPool-service:cleanServiceBuilderException in thread "main" java.sql.SQLException: No suitable driver found for jdbc:mysql://<my db dsn>
thanks for your help
Phil
Philippe Thibault:java.sql.SQLException: No suitable driver found for jdbc:mysql://<my db dsn>
As a sanity check, since cleanServiceBuilder is part of
the DB
Support Gradle Plugin, have you already followed the
instructions to add a MySQL driver to the dbSupport configuration?
I did stumble upon this gradle configuration. Is it a new requirement? My service builder project was building and cleaning fine since I recently upgraded the workspace bundle to 7.1-ga1 (from 7.0-ga6). I am using Liferay Worspace in eclipse. I did create a new service-builder project in there for testing purpose and did not see this configuration. I thought the db support gradle plugin was already ready to go in Liferay Workspace. Indeed it succeeds in obtaining the bundle jdbc configuration for the dsn, username and password, but it fails to obtain the jdbc mysql driver. Could it be a registering problem, needing a
<span>Class</span><span>.</span><span>forName</span><span>(</span><span>"com.mysql.jdbc.Driver"</span><span>);</span>
somewhere? I did have to add this call in a module project accessing an external mysql database. Or I may be completely off the track ... !
thanks for your help
Update: I did add the gradle dependency for dbsupport plugin as stated here and the cleanServiceBuilder task completed successfully. Thanks Minhchau for the pointer.
However why it was working with my previous installation of liferay workspace and where did it get its mysql driver without this dependency configuration I still don't know, but hey it is working now so let's not complain overlong ...