0

I have a Spring Boot MVC project. It works fine with h2 database and also fine in local postgre database with following application.properties configuration

spring.datasource.url=myUrl
spring.datasource.username=myUsername
spring.datasource.password=myPassword

But when I am trying to deploy it in Heroku it is getting this following error:

Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

If I use this configuration

spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=herokuPostgreSqlDbUrl
spring.datasource.username=herokuUsername
spring.datasource.password=mherokuPassword

I am getting this when try to run my project from STS and failed deployment.

Caused by: java.sql.SQLException: Driver:org.postgresql.Driver@17a3dff6 returned null for URL:myUrl

My pom is :

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.4-1206-jdbc42</version>
        </dependency>

Can any body help ?

1 Answer 1

1

You need a proper JDBC url. See: https://springframework.guru/configuring-spring-boot-for-postgresql/

Sign up to request clarification or add additional context in comments.

1 Comment

I am using spring.datasource.url=jdbc:postgres://ec2-54-235-124-2.compute-1.amazonaws.com:5432/xyzDbname as jdbc url is it ok ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.