Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

google app engine - java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.GoogleDriver]

I am trying to connect to my database from the Google Flexible Environment to the Google Cloud SQL. The connection string and the driver class are shown below:

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.GoogleDriver" />
    <property name="url" value="jdbc:google:mysql://mz-test:us-central1:mz-life-cloudsql-prod/mz_db" />
    <property name="username" value="root" />
    <property name="password" value="" />
</bean>

However, I am currently getting

org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/classes/context/applicationContext-jooq.xml]: 
            Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; 
            nested PropertyAccessExceptions (1) are:|PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; 
            nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [com.mysql.jdbc.GoogleDriver]

The database I am trying connecting to is a Second Generation Cloud SQL MySQL database.

Why am I getting this exception?

The App Engine had this <use-google-connector-j> property. I've not seen this property for the Flexible Environment - at least not on those pages what I've been reading so far. Is there anything I'd have to set in addtion in my app.yaml file?


Not sure if I have to do this in Flexible Environment but I am currently trying to set the use-google-connector-j property to true in my yaml file:

use-google-connector-j: true

but it appears this is not working at the moment: https://code.google.com/p/googleappengine/issues/detail?id=11444

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...