cleanServiceBuilder fails

thumbnail
Philippe Thibault, modified 7 Years ago. Junior Member Posts: 46 Join Date: 9/11/12 Recent Posts

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

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
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?

thumbnail
Philippe Thibault, modified 7 Years ago. Junior Member Posts: 46 Join Date: 9/11/12 Recent Posts

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

thumbnail
Philippe Thibault, modified 7 Years ago. Junior Member Posts: 46 Join Date: 9/11/12 Recent Posts

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 ...