-
Notifications
You must be signed in to change notification settings - Fork 154
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
Can't do diff with spring-boot: Unable to build Hibernate SessionFactory: The application must supply JDBC connections #381
Comments
Seeing the same issue, is there any update on this? |
I have the same issue. Also if I run Maven with
|
From https://stackoverflow.com/a/60363182/2200569
to my |
Problem started with version 4.3.1 |
We are experiencing same issue after upgrading our Liquibase deps:
|
Mine has a strange behavior, but with satisfactory result. The problem of console log
pom.xml<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.10</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>br.midwest</groupId>
<artifactId>folha-pagamento-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>folha-pagamento-service</name>
<description>folha-pagamento-service</description>
<properties>
<java.version>11</java.version>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<spring.version>2.7.10</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>${spring.version}</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>4.21.1</version>
<configuration>
<propertyFile>src/main/resources/liquibase.yaml</propertyFile>
<changeLogFile>src/main/resources/master.yaml</changeLogFile>
<outputChangeLogFile>src/main/resources/db/changelog/${maven.build.timestamp}_changelog.yaml
</outputChangeLogFile>
<diffChangeLogFile>src/main/resources/db/changelog/${maven.build.timestamp}_changelog.yaml
</diffChangeLogFile>
<verbose>true</verbose>
<dropFirst>false</dropFirst>
</configuration>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate5</artifactId>
<version>4.21.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project> application.yamlspring:
datasource:
url: jdbc:postgresql://localhost:5432/folha_pagamento
username: postgres
password: postgres
driver-class-name: org.postgresql.Driver
jpa:
hibernate:
ddl-auto: none
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQL95Dialect
format_sql: true
liquibase:
change-log: classpath:master.yaml
enabled: true liquibase.yamlurl: jdbc:postgresql://localhost:5432/folha_pagamento
defaultSchemaName: public
username: postgres
password: postgres
classpath: src/main/resources
changeLogFile: src/main/resources/master.yaml
driver: org.postgresql.Driver
referenceUrl: hibernate:spring:br.midwest.folhapagamentoservice.entity?dialect=org.hibernate.dialect.PostgreSQL95Dialect
referenceDriver: liquibase.ext.hibernate.database.connection.HibernateDriver master.xmldatabaseChangeLog:
- includeAll:
path: ./db/changelog generated changelogdatabaseChangeLog:
- changeSet:
id: 1682073923601-1
author: rntjr (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
nullable: false
primaryKey: true
primaryKeyName: beneficio_dependentePK
name: id
type: BIGINT
- column:
name: create_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: tenant_id
type: VARCHAR(255)
- column:
name: update_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: uuid
type: VARCHAR(255)
- column:
name: codigo
type: VARCHAR(255)
- column:
name: data_final
type: date
- column:
name: data_inicio
type: date
- column:
name: dependente_id
type: BIGINT
tableName: beneficio_dependente
- changeSet:
id: 1682073923601-2
author: rntjr (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
nullable: false
primaryKey: true
primaryKeyName: contato_email_pessoaPK
name: id
type: BIGINT
- column:
name: create_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: tenant_id
type: VARCHAR(255)
- column:
name: update_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: uuid
type: VARCHAR(255)
- column:
name: email
type: VARCHAR(255)
- column:
name: is_principal
type: BOOLEAN
- column:
name: pessoa_id
type: BIGINT
tableName: contato_email_pessoa
- changeSet:
id: 1682073923601-3
author: rntjr (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
nullable: false
primaryKey: true
primaryKeyName: contato_telefone_pessoaPK
name: id
type: BIGINT
- column:
name: create_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: tenant_id
type: VARCHAR(255)
- column:
name: update_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: uuid
type: VARCHAR(255)
- column:
constraints:
nullable: false
name: isPrincipal
type: BOOLEAN
- column:
name: telefone
type: VARCHAR(255)
- column:
name: pessoa_id
type: BIGINT
tableName: contato_telefone_pessoa
- changeSet:
id: 1682073923601-4
author: rntjr (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
nullable: false
primaryKey: true
primaryKeyName: dependentePK
name: id
type: BIGINT
- column:
name: create_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: tenant_id
type: VARCHAR(255)
- column:
name: update_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: uuid
type: VARCHAR(255)
- column:
name: cpf
type: VARCHAR(255)
- column:
name: data_limite_irpf
type: date
- column:
name: data_salario_familia
type: date
- column:
name: data_nascimento
type: date
- column:
name: dependencia
type: VARCHAR(255)
- column:
name: escolaridade
type: VARCHAR(255)
- column:
name: estado_civil
type: VARCHAR(255)
- column:
name: is_dependente_financeiro
type: BOOLEAN
- column:
name: is_dependente_pcd
type: BOOLEAN
- column:
name: is_universitario
type: BOOLEAN
- column:
name: naturalidade
type: VARCHAR(255)
- column:
name: nome_completo
type: VARCHAR(255)
- column:
name: parentesco
type: VARCHAR(255)
- column:
name: sexo
type: VARCHAR(255)
- column:
name: pessoa_id
type: BIGINT
tableName: dependente
- changeSet:
id: 1682073923601-5
author: rntjr (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
nullable: false
primaryKey: true
primaryKeyName: pessoaPK
name: id
type: BIGINT
- column:
name: create_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: tenant_id
type: VARCHAR(255)
- column:
name: update_at
type: TIMESTAMP WITHOUT TIME ZONE
- column:
name: uuid
type: VARCHAR(255)
- column:
name: bairro
type: VARCHAR(255)
- column:
name: categoria_cnh
type: VARCHAR(255)
- column:
name: cep
type: VARCHAR(255)
- column:
name: cid_pcd
type: VARCHAR(255)
- column:
name: cidade
type: VARCHAR(255)
- column:
name: complemento_endereco
type: VARCHAR(255)
- column:
name: concelho_ordem_profissional
type: VARCHAR(255)
- column:
name: cor_raca
type: VARCHAR(255)
- column:
name: cpf
type: VARCHAR(255)
- column:
name: data_emissao_cnh
type: date
- column:
name: data_expedicao_ctps
type: date
- column:
name: data_emissao_identidade
type: date
- column:
name: data_expedicao_titulo_eleitor
type: date
- column:
name: data_nascimento
type: date
- column:
name: data_validade_cnh
type: date
- column:
name: escolaridade
type: VARCHAR(255)
- column:
name: estado_civil
type: VARCHAR(255)
- column:
name: logradouro
type: VARCHAR(255)
- column:
name: nacionalidade
type: VARCHAR(255)
- column:
name: naturalidade
type: VARCHAR(255)
- column:
name: nome_completo
type: VARCHAR(255)
- column:
name: nome_conjuge
type: VARCHAR(255)
- column:
name: nome_mae
type: VARCHAR(255)
- column:
name: nome_social
type: VARCHAR(255)
- column:
name: numero_cnh
type: VARCHAR(255)
- column:
name: numero_ctps
type: VARCHAR(255)
- column:
name: numero_endereco
type: VARCHAR(255)
- column:
name: numero_identidade
type: VARCHAR(255)
- column:
name: numero_pis_pasep_nit_nis
type: VARCHAR(255)
- column:
name: numero_registro_concelho_ordem_profissional
type: VARCHAR(255)
- column:
name: numero_titulo_eleitor
type: VARCHAR(255)
- column:
name: orgao_expedidor_identidade
type: VARCHAR(255)
- column:
name: secao_titulo_eleitor
type: VARCHAR(255)
- column:
name: serie_ctps
type: VARCHAR(255)
- column:
name: sexo
type: VARCHAR(255)
- column:
name: tipo_pcd
type: VARCHAR(255)
- column:
name: uf
type: INTEGER
- column:
name: uf_ctps
type: VARCHAR(255)
- column:
name: uf_orgao_expedidor_identidade
type: VARCHAR(255)
- column:
name: uf_titulo_eleitor
type: VARCHAR(255)
- column:
name: zona_titulo_eleitor
type: VARCHAR(255)
tableName: pessoa
- changeSet:
id: 1682073923601-6
author: rntjr (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: dependente_id
baseTableName: beneficio_dependente
constraintName: FK3ylg58dm91ibqvgdr7eprpoc1
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: dependente
validate: true
- changeSet:
id: 1682073923601-7
author: rntjr (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: pessoa_id
baseTableName: contato_email_pessoa
constraintName: FK4oqnho4yvejclv7hienlj4aoa
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: pessoa
validate: true
- changeSet:
id: 1682073923601-8
author: rntjr (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: pessoa_id
baseTableName: contato_telefone_pessoa
constraintName: FKd162t73p8oqd1tsygllaawtj8
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: pessoa
validate: true
- changeSet:
id: 1682073923601-9
author: rntjr (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: pessoa_id
baseTableName: dependente
constraintName: FKm16db97d4wyt8bw3mxp7w9do4
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: pessoa
validate: true |
I managed to fix this (the first exception) by adding a
|
Same problem here. |
Any news? |
Hi there, I have met the same problem with my second project. I have spent many hours trying to launch liquibase diff with hibernate as a reference database, but the best what I could achieve - an empty diff. Just a few moments ago I have noticed that my first project (which has been running diffs fine for more than a year already) has a customized script to generate migrations. It is happened that I didn't run the compileJava task before launching diffChangelog. Now everything seems to work fine. My gradle config for liquibase:
Generating diff:
The HHH000181 and HHH000342 persist, however, but it seems not affecting anything important. Hope it helps. :)
Update: SpringPhysicalNaming strategy was deprecated. spring-projects/spring-boot#27352
|
I am facing this issue as well. Any update on this?
Dependencies:
|
I'm currently engaging with hibernate developpers at hibernate/hibernate-orm#7182 (comment), I think the possible fix today is to reapply #616 (reverted in #621) : hibernate.temp.use_jdbc_metadata_defaults=false everywhere And when this flag is removed from hibernate in the future, they will have changed their code to be equivalent to hibernate.temp.use_jdbc_metadata_defaults=false when enough properties are set, so ensure we can set these properties (e.g. like https://github.com/liquibase/liquibase-hibernate/blob/main/src/main/java/liquibase/ext/hibernate/database/HibernateSpringPackageDatabase.java#L93 ) but for all cases NOTE: I'm only talking about the benine exception "java.lang.UnsupportedOperationException: The application must supply JDBC connections". it doesn't cause any problems apart from confusion |
Hi everyone, is there any progress on this one? I have a spring boot 3 project and a liquibase-maven-plugin I use to execute the liquibase-diff command. I supply the properties file where all the properties are set but I sitll get the error "The application must supply JDBC connections" as well as "Error setting up or running Liquibase: |
Hi - this has been fixed by PR #641 than un-un-revert jonest fix and was released on version 4.26.0 . Please reopen the issue if the problem still persists. |
Hi there. I'm really stuck on this.
I have existing (& working) JPA models in spring-boot - hibernate - postgres stack
I can even run generateChangeLog, but not diff with this hibernate plugin
My
liquibase.properties
are:I've tried to import all existing dependencies for model classess:
And the result is still the same..:
I'm not sure if it relates to this exception from the debug output (Class org.hibernate.boot.jaxb.hbm.spi.package-info doesn't exist in hibernate-core anymore..)
I've tried to add different packages, various versions of liquibase, nothing helps..
Is it just me, or how can I find the problem here (obviously the exception here is misleading..)
Versions stack:
Thanks in advance for your help
The text was updated successfully, but these errors were encountered: