google-app-engine


Google App Engine for Spring Boot application always giving java.lang.ClassNotFoundException: com.mysql.jdbc.GoogleDriver


I have a Sprint Boot app with Maven. And I have enabled MySQL Connector/J ( true) for my application. But after deployment of my app in Google Cloud, I am always getting "Cannot load JDBC driver class 'com.mysql.jdbc.GoogleDriver'" (java.lang.ClassNotFoundException: com.mysql.jdbc.GoogleDriver). Kindly check and advice on this at the earliest. My code to get connection is as below.
BasicDataSource ds = new BasicDataSource();
System.out.println("Inside prod-->");
try {
Class.forName("com.mysql.jdbc.GoogleDriver");
System.out.println("Inside Class.forName-->");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("Inside ClassNotFoundException-->");
}
System.out.println("after Class.forName-->");
ds.setDriverClassName(props.getProperty("gcdriverClassName"));
ds.setUrl(props.getProperty("gcurl"));//System.getProperty("ae-cloudsql.cloudsql-database-url")
ds.setUsername(props.getProperty("gcusername"));
ds.setPassword(props.getProperty("gcpassword"));
ds.setInitialSize(Integer.parseInt(props.getProperty("gcinit_pool_size")));
ds.setMaxActive(Integer.parseInt(props.getProperty("gcmax_pool_size")));
AFAIK, com.mysql.jdbc.GoogleDriver class is not automatically available in the App Engine runtime. So you have to enable it by adding <use-google-connector-j>true</use-google-connector-j> element into your appengine-web.xml located in PROJECT_HOME/src/main/webapp/WEB-INF/ directory.
Please refer "Using Google Cloud SQL" documentation more details.

Related Links

Cannot authorize my google app to access my Cloud SQL instance
GooglePlaces autocomplete - more than one input
Import GAE data through Storage into BigQuery fails
Google AppEngine Tutorial, difference between code snippets
OpenID sign in not working in Gmail contextual gadget
Problems getting a basic JAXRS + JPA version working on GAE
Appengine's Indexing order, cursors, and aggregation
Works locally but throws java.lang.IncompatibleClassChangeError when deployed to GAE
Google App Engine Datastore: Turkish Characters won't sort properly
JPA + Google SQL + GWT + Eclipse
how to convert the string version of a key back into a form that I can use the get() function on to get the entity instance
Redirect To Specific URL in Google app engine
Exporting data to Google Spreadsheet from Google App Engine (Java version)
How is md5Hash calculated for com.google.appengine.api.blobstore.BlobInfo
Bad response to a BigQuery query: kind:discovery#restDescription instead of bigquery#queryResults
Google app engine jobs in datastore admin freeze

Categories

HOME
cygwin
localization
facebook-oauth
paraview
ng-idle
c99
dns
case
powerpoint
yahoo-finance
serialization
socket.io
mips
settings
google-cloud-datalab
drop-down-menu
plist
jsonpath
digital-signature
nodemcu
asp.net-core-webapi
pagespeed
flask-sqlalchemy
bulletphysics
angular-translate
paragraph
cart
hreflang
android-gridview
openwhisk
mnist
connection-pool
password-protection
c9.io
setup.py
placeholder
xmldocument
show-hide
x++
servermanager
dtsearch
launchctl
trojan
pair-programming
java-websocket
janus
lsyncd
flyout
android-instrumentation
juice-ui
qtplugin
centrifuge
delta
dimension
lua-telegram-bot
tracker-enabled-dbcontext
httpruntime.cache
spring-retry
concurrentmodification
oracle-spatial
opserver
doctype
ember-cli-rails
haskell-warp
cwrsync
mraid
mmwormhole
apache-spark-1.3
delayed-execution
webfinger
dot42
android-audiorecord
kendo-dataviz
unit-of-work
poker
onload-event
tree-balancing
pstack
pyunit
garbage
lambdaj
kqueue
wiimote
urlrewriter
google-ajax-api
webdev.webserver
jqote
cuteeditor
openfaces
application-verifier
duplex
wcf-instancing
lobo-cobra

Resources

Encrypt Message