I have a database instance on Amazon RDS which is configured:
My VPC Security group, both Inbound and Outbound are configured like below:
My VPC DNS Resolution and DNS Hostnames are activated. I can connect to this instance and execute queries without problems from MySQLWorkbench. I'm configuring it in my GAE Eclipse using persistence.xml:
<persistence-unit name="myworld">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider >
<!-- MODELS -->
...
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://myworld.cy3caqn3kkz0.eu-west-1.rds.amazonaws.com:3306/myworld"/>
<property name="javax.persistence.jdbc.user" value="myworld"/>
<property name="javax.persistence.jdbc.password" value="******"/>
<property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.MySQLPlatform" />
</properties>
And my appengine_web.xml:
<threadsafe>true</threadsafe>
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
<property name="ae-cloudsql.cloudsql-database-url" value="jdbc:mysql://myworld.cy3caqn3kkz0.eu-west-1.rds.amazonaws.com:3306/myworld?user=myworld&password=******" />
<property name="cloudsql.url" value="jdbc:mysql://myworld.cy3caqn3kkz0.eu-west-1.rds.amazonaws.com:3306/myworld?user=myworld&password=******"/>
</system-properties>
I'm able to connect and execute queries when I start my GAE project locally and everything works fine but when I deploy it online I receive the following exception:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
Error Code: 0
I have read lots of posts, blogs, questions and answers on stackoverflow but I didn't figured out what I'm doing wrong.
Please, any suggestion, clue, tip will be very appreciate once I'm trying to fix it for the last whole week.
Thanks you guys!