We're updating the issue view to help you get more done. 

jdk11 - liquibase:diff command throws Null pointer exception

Description

When I try to execute the diff command with mvn liquibase:diff I get an error message:
Error getting default schema java.lang.NullPointerException.
Running same scenario using java8(mvn uses jdk8) works fine.

Error:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 [WARNING] Unknown database: Hibernate [INFO] Performing Diff on database postgres @ jdbc:postgresql://localhost:5432/db?currentSchema=anySchema (Default Schema: anySchema) [INFO] Error getting default schema java.lang.NullPointerException at liquibase.executor.jvm.JdbcExecutor$QueryCallableStatementCallback.doInCallableStatement (JdbcExecutor.java:452) at liquibase.executor.jvm.JdbcExecutor.execute (JdbcExecutor.java:93) at liquibase.executor.jvm.JdbcExecutor.query (JdbcExecutor.java:135) at liquibase.executor.jvm.JdbcExecutor.query (JdbcExecutor.java:146) at liquibase.executor.jvm.JdbcExecutor.queryForObject (JdbcExecutor.java:154) at liquibase.executor.jvm.JdbcExecutor.queryForObject (JdbcExecutor.java:169) at liquibase.executor.jvm.JdbcExecutor.queryForObject (JdbcExecutor.java:164) at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName (AbstractJdbcDatabase.java:327) at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName (AbstractJdbcDatabase.java:292) at liquibase.CatalogAndSchema.customize (CatalogAndSchema.java:151) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot (SnapshotGeneratorFactory.java:184) at liquibase.command.core.DiffCommand.createReferenceSnapshot (DiffCommand.java:221) at liquibase.command.core.DiffCommand.createDiffResult (DiffCommand.java:143) at liquibase.command.core.DiffToChangeLogCommand.run (DiffToChangeLogCommand.java:51) at liquibase.command.AbstractCommand.execute (AbstractCommand.java:19) at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog (CommandLineUtils.java:237) at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog (CommandLineUtils.java:212) at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.performLiquibaseTask (LiquibaseDatabaseDiff.java:177) at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute (AbstractLiquibaseMojo.java:366) at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.execute (LiquibaseDatabaseDiff.java:136) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.823 s [INFO] Finished at: 2019-06-03T12:34:09+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.6.3:diff (default-cli) on project akira-rest: Error setting up or running Liquibase: liquibase.command.CommandExecutionException: java.lang.NullPointerException -> [Help 1]

Pom.xml

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 <plugin> <groupId>org.liquibase</groupId> <artifactId>liquibase-maven-plugin</artifactId> <version>3.6.3</version> <dependencies> <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> <version>3.25.0-GA</version> </dependency> <dependency> <groupId>org.liquibase.ext</groupId> <artifactId>liquibase-hibernate5</artifactId> <version>3.7</version> </dependency> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>2.0.1.Final</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <version>2.1.4.RELEASE</version> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>42.2.5</version> </dependency> </dependencies> <configuration> <changeLogFile>src/main/resources/db.changelog-master.xml</changeLogFile> <diffChangeLogFile> src/main/resources/master-configuration/${maven.build.timestamp}-AKIRA-XX-changelog.xml </diffChangeLogFile> <driver>org.postgresql.Driver</driver> <url>${db.url}</url> <defaultSchemaName>${db.schema}</defaultSchemaName> <diffExcludeObjects>table:.*_aud,REVINFO</diffExcludeObjects> <changelogCatalogName>${db.schema}</changelogCatalogName> <username>${db.username}</username> <password>${db.password}</password> <referenceUrl> hibernate:spring:com.xxx.yyy?dialect=org.hibernate.dialect.PostgreSQL82Dialect&amp;hibernate.ejb.naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy </referenceUrl> <logging>debug</logging> <verbose>true</verbose> </configuration> </plugin>

Environment

java11, spring-boot 2.1.4.RELEASE, liquibase-hibernate5 3.7, Postgresql

Status

Assignee

Unassigned

Reporter

Sergio Gonzalez

Labels

None

Affects versions

3.6.3

Priority

Major