I’m trying to build an API on spring boot version 3.1.1, but I got these errors:
`Could not obtain connection to query metadata.
java.lang.NullPointerException: Cannot invoke "org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(java.sql.SQLException, String)" because the return value of "org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.sqlExceptionHelper()" is null
org.hibernate.HibernateException: 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)`
This is my application.properties:
spring.datasource.url= jdbc:postgresql://localhost:5432/db-name spring.datasource.username=postgres-user spring.datasource.password=password spring.jpa.hibernate.ddl-auto=update spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
I’m using postgresql on linux mint and my version is
(PostgreSQL) 14.12 (Ubuntu 14.12-0ubuntu0.22.04.1).
I tried to specify the dialect with:
`spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect`
However, it had no effect on the error.
Someone knows why these errors happened and how to fix it?
Jéssica Zucco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.