Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the spring.jpa.database-platform to provide better log messages #2015

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

arueth
Copy link
Collaborator

@arueth arueth commented Feb 9, 2024

Background

Log messages for DB related issues are not very helpful, an example:

buildNativeEntityManagerFactory | Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'jakarta.persistence.jdbc.url' for common cases or 'hibernate.dialect' when a custom Dialect implementation must be provided)
refresh | Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'jakarta.persistence.jdbc.url' for common cases or 'hibernate.dialect' when a custom Dialect implementation must be provided)

Change Summary

Setting the spring.jpa.database-platform provides more useful log messages.

Caused by: org.springframework.orm.jpa.JpaSystemException: Unable to acquire JDBC Connection [FATAL: password authentication failed for user "admin"] [n/a]

Testing Procedure

Tested locally with skaffold and in my clusters

Copy link
Member

@bourgeoisor bourgeoisor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@arueth arueth merged commit fee8c47 into main Feb 9, 2024
8 checks passed
@arueth arueth deleted the rueth-jpa branch February 9, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants