You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System Type & Version:
macOS Catalina Version 10.15.7
Description
Hi!
I want to report a bug. I didn’t found a ticket at the moment of writting this lines. If you have a setup which enables you to create a diff-changelog between hibernate and a database a NullPointerException will be thrown.
The reason is that liquibase.database.DatabaseFactory#findCorrectDatabaseImplementation calls isCorrectDatabaseImplementation(connection) on all implementedDatabase's where also liquibase.database.core.CockroachDatabase is contained. Now liquibase.database.core.CockroachDatabase#isCorrectDatabaseImplementation is trying to create a statement but this method returns in our case null because a liquibase.ext.hibernate.database.connection.HibernateConnection has been passed as argument. As a result a NullPointerException will be thrown and can't be catched by a SQLException.
Steps To Reproduce
List the steps to reproduce the behavior.
Create java class like:
Entity @table(name = "person", uniqueConstraints = { @UniqueConstraint(name = "uc_name", columnNames = "name")
})
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name = "name")
private String name;
}
Create a liquibase.properties file like:
url=jdbc:mariadb://localhost:3310/troubleshoot
defaultSchemaName=troubleshoot
Hi @neivkovic We just released 4.2.2 to fix this case. It contains PR #1580 Please update your maven plugin to use 4.2.2 and you should see this error go away. Let us know if it does fix your issue so that we can close this one.
Environment
spring-boot-starter-data-jpa project 2.3.0.RELEASE
Liquibase Version:
<liquibase-core.version>4.1.1
Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>
liquibase-maven-plugin
Liquibase Extension(s) & Version:
<liquibase-hibernate5.version>4.1.1
Database Vendor & Version:
mariadb:10.4.11
Operating System Type & Version:
macOS Catalina Version 10.15.7
Description
Hi!
I want to report a bug. I didn’t found a ticket at the moment of writting this lines. If you have a setup which enables you to create a diff-changelog between hibernate and a database a NullPointerException will be thrown.
The reason is that liquibase.database.DatabaseFactory#findCorrectDatabaseImplementation calls isCorrectDatabaseImplementation(connection) on all implementedDatabase's where also liquibase.database.core.CockroachDatabase is contained. Now liquibase.database.core.CockroachDatabase#isCorrectDatabaseImplementation is trying to create a statement but this method returns in our case null because a liquibase.ext.hibernate.database.connection.HibernateConnection has been passed as argument. As a result a NullPointerException will be thrown and can't be catched by a SQLException.
Steps To Reproduce
List the steps to reproduce the behavior.
Entity
@table(name = "person", uniqueConstraints = {
@UniqueConstraint(name = "uc_name", columnNames = "name")
})
public class Person {
}
url=jdbc:mariadb://localhost:3310/troubleshoot
defaultSchemaName=troubleshoot
username=troubleshooter
password=password
driver=org.mariadb.jdbc.Driver
referenceDriver=liquibase.ext.hibernate.database.connection.HibernateDriver
referenceUrl=hibernate:spring:at.frink.troubleshoot?
dialect=org.hibernate.dialect.MariaDB53Dialect&
hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&
hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
Actual Behavior
NullPointerException
Expected/Desired Behavior
A new changelogfile should be created.
Attached the project for bug reproduction
troubleshoot_.zip
The text was updated successfully, but these errors were encountered: