title: com.google.cloud.sql.mysql.SocketFactory ClassNotFoundException
body: <p>Hi I am new to web development and am trying to get activejdbc to connect to a cloud sql instance... I am getting the following stacktrace:</p>
  
  <pre><code>    [ERROR] Failed to execute goal org.javalite:db-migrator-maven-plugin:1.4.11:migrate (dev_migrations) on project activeweb-simple: Execution dev_migrations of go
  al org.javalite:db-migrator-maven-plugin:1.4.11:migrate failed: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create socket fa
  ctory 'com.google.cloud.sql.mysql.SocketFactory' due to underlying exception:  -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.javalite:db-migrator-maven-plugin:1.4.11:migrate (dev_migrations) on project
  activeweb-simple: Execution dev_migrations of goal org.javalite:db-migrator-maven-plugin:1.4.11:migrate failed: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransien
  tConnectionException: Could not create socket factory 'com.google.cloud.sql.mysql.SocketFactory' due to underlying exception:
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.PluginExecutionException: Execution dev_migrations of goal org.javalite:db-migrator-maven-plugin:1.4.11:migrate failed: com.m
  ysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create socket factory 'com.google.cloud.sql.mysql.SocketFactory' due to underlying ex
  ception:
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
          ... 20 more
  Caused by: org.javalite.db_migrator.MigrationException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create socket factory 'c
  om.google.cloud.sql.mysql.SocketFactory' due to underlying exception:
          at org.javalite.db_migrator.DbUtils.openConnection(DbUtils.java:183)
          at org.javalite.db_migrator.maven.AbstractDbMigrationMojo.openConnection(AbstractDbMigrationMojo.java:178)
          at org.javalite.db_migrator.maven.AbstractDbMigrationMojo.openConnection(AbstractDbMigrationMojo.java:170)
          at org.javalite.db_migrator.maven.MigrateMojo.executeMojo(MigrateMojo.java:21)
          at org.javalite.db_migrator.maven.AbstractDbMigrationMojo.executeCurrentConfiguration(AbstractDbMigrationMojo.java:96)
          at org.javalite.db_migrator.maven.AbstractDbMigrationMojo.execute(AbstractDbMigrationMojo.java:80)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
          ... 21 more
  Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create socket factory 'com.google.cloud.sql.mysql.SocketFactory' due
  to underlying exception:
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
          at com.mysql.jdbc.Util.getInstance(Util.java:360)
          at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
          at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
          at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
          at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
          at com.mysql.jdbc.MysqlIO.createSocketFactory(MysqlIO.java:3194)
          at com.mysql.jdbc.MysqlIO.&lt;init&gt;(MysqlIO.java:293)
          at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2232)
          at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
          at com.mysql.jdbc.ConnectionImpl.&lt;init&gt;(ConnectionImpl.java:790)
          at com.mysql.jdbc.JDBC4Connection.&lt;init&gt;(JDBC4Connection.java:44)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
          at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
          at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
          at java.sql.DriverManager.getConnection(DriverManager.java:664)
          at java.sql.DriverManager.getConnection(DriverManager.java:247)
          at org.javalite.db_migrator.DbUtils.openConnection(DbUtils.java:181)
          ... 27 more
  Caused by: java.lang.ClassNotFoundException: com.google.cloud.sql.mysql.SocketFactory
          at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:264)
          at com.mysql.jdbc.MysqlIO.createSocketFactory(MysqlIO.java:3192)
      ... 43 more
  </code></pre>
  
  <p>My connection string in database.properties looks like this:</p>
  
  <pre><code>development.url=jdbc:mysql://google/database?cloudSqlInstance=project:location:instance&amp;socketFactory=com.google.cloud.sql.mysql.SocketFactory&amp;user=dbuser&amp;password=dbuserpassword&amp;useSSL=false
  </code></pre>
  
  <p>I have used the same connection string with spring-hibernate configuration with out a problem, but would like to try activeweb-activejdbc.  Why the compiler cannot find the class?  I have included google cloud sql dependency in pom.xml:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.google.cloud.sql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-socket-factory-connector-j-6&lt;/artifactId&gt;
          &lt;version&gt;1.0.2&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>