I know this question appeared on stackoverflow, but none of the solutions worked for me. I have a Spring Boot application that is auto-configured. I have this application.properties :
#HEROKU CREDENTIALS
spring.datasource.url=jdbc:postgres://my_url/database?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
spring.datasource.username=username
spring.datasource.password=my_password
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.show-sql=true
When application is deployed on Heroku everything works perfectly. When I try to run it on my local machine I can't connect to the database.
java.sql.SQLException: Driver:org.postgresql.Driver@69ec93c2 returned null for URL: my_url
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:329) ~[tomcat-jdbc-8.5.14.jar:na]
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:203) ~[tomcat-jdbc-8.5.14.jar:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:735) [tomcat-jdbc-8.5.14.jar:na]
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:667) [tomcat-jdbc-8.5.14.jar:na]
As you can see in the application.properties I added the ssl and sslfactory but no success.
jdbc:postgres://should bejdbc:postgresql://, but that doesn't seem to be the main problem.