im new to aws and i have succssefully deployed war file but im still getting a JDBC connection error before i generated the war. Cant figure out what im doing wrong. any help? heres my application.properties file
Asked
Active
Viewed 109 times
0
-
And you've set the environment variables? – Simon Martinelli Mar 23 '21 at 19:33
-
Yes and i double checked them.Created the db and did all the configuration required @SimonMartinelli – Shawaal Saif Mar 23 '21 at 19:34
-
Are you using Beanstalk? – Simon Martinelli Mar 23 '21 at 19:38
-
And can you post the stack trace? – Simon Martinelli Mar 23 '21 at 19:38
-
yes im using the beanstalk and downloaded the logs and posted the image of the stack trace. @SimonMartinelli – Shawaal Saif Mar 23 '21 at 19:43
-
And all firewall rules are correct? – Simon Martinelli Mar 23 '21 at 19:48
-
sorry I dont know anything about that. can you explain? @SimonMartinelli – Shawaal Saif Mar 23 '21 at 19:51
-
You have to allow access from Beanstalk to the database – Simon Martinelli Mar 23 '21 at 20:03
-
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.db.html – Simon Martinelli Mar 23 '21 at 20:03
-
oh.Yes all firewall rules are correct and connected the db correctly. all inbound rules required are exposed too. @SimonMartinelli – Shawaal Saif Mar 23 '21 at 20:09
-
It's this the whole stack trace? Is there no SQL error from mysql? – Simon Martinelli Mar 23 '21 at 20:13
-
@ShawaalSaif, from your application, can you print out the values of the environment variables before connection is made so you are sure everything is resolved correctly? Also, have you tried to connect to the db from your machine and ensured that it accepts connections? I'd suggest you follow all the steps in the answer here: https://stackoverflow.com/questions/2983248/ – naimdjon Mar 23 '21 at 20:16
-
im unable to upload the whole stack trace but this this is the root cause cant figure out what im doing wrong. Caused by: org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution @SimonMartinelli – Shawaal Saif Mar 23 '21 at 20:19
-
@naimdjon im able to connect to my database on my machine and the application is running perfectly locally on my machine but after deploying it on aws I get JDBCConnectionException. – Shawaal Saif Mar 23 '21 at 20:22
-
https://stackoverflow.com/questions/46311096/unable-to-establish-connection-to-jdbcmysql-communication-link-failure – Simon Martinelli Mar 23 '21 at 20:26
1 Answers
0
To learn how to build a Java web app that stores app data in an Amazon RDS MySQL instance and then how to deploy the web app to the cloud, see this doc. It walks you through the process. Make sure you set your inbound rules properly and you specify your database connection string. If you can connect from your local machine but not Elastic Beanstalk - looks like you did not setup the inbound rule to allow a connection.
Creating the Amazon Relational Database Service item tracker

smac2020
- 9,637
- 4
- 24
- 38