java.lang.NullPointerException

JIRA | Robert Rasmussen | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Dropwizard has upgraded to liquibase 3.0.1, and when I try to run liquibase's update command I get the following exception: {code} Exception in thread "main" java.lang.NullPointerException at liquibase.diff.compare.DatabaseObjectComparatorFactory.isSameObject(DatabaseObjectComparatorFactory.java:91) at liquibase.snapshot.DatabaseSnapshot.get(DatabaseSnapshot.java:180) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:137) at liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFactory.java:87) at liquibase.snapshot.SnapshotGeneratorFactory.hasDatabaseChangeLogTable(SnapshotGeneratorFactory.java:160) at liquibase.database.AbstractJdbcDatabase.hasDatabaseChangeLogTable(AbstractJdbcDatabase.java:726) at liquibase.database.AbstractJdbcDatabase.getRanChangeSetList(AbstractJdbcDatabase.java:1127) at liquibase.database.AbstractJdbcDatabase.checkDatabaseChangeLogTable(AbstractJdbcDatabase.java:695) at liquibase.Liquibase.checkDatabaseChangeLogTable(Liquibase.java:602) at liquibase.Liquibase.update(Liquibase.java:130) at com.codahale.dropwizard.migrations.DbMigrateCommand.run(DbMigrateCommand.java:58) at com.codahale.dropwizard.migrations.DbCommand.run(DbCommand.java:51) at com.codahale.dropwizard.migrations.AbstractLiquibaseCommand.run(AbstractLiquibaseCommand.java:54) at com.codahale.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:62) at com.codahale.dropwizard.cli.Cli.run(Cli.java:69) at com.codahale.dropwizard.Application.run(Application.java:72) at com.example.helloworld.HelloWorldApplication.main(HelloWorldApplication.java:22) {code} I tracked this down to {{liquibase.diff}} (and after fixing that, {{liquibase.datatype}}) not being in the default packagesToScan list specified in {{liquibase.servicelocator.ServiceLocator}}. I changed the list to match the values in META-INF/MANIFEST.MF, and that got me going. I realize I could also fix it by specifying the {{liquibase.scan.packages}} system property, but it looks like the default packagesToScan list was in sync with the manifest at one point and should be updated. I'll submit a pull request with the change.

    JIRA | 4 years ago | Robert Rasmussen
    java.lang.NullPointerException
  2. 0

    Dropwizard has upgraded to liquibase 3.0.1, and when I try to run liquibase's update command I get the following exception: {code} Exception in thread "main" java.lang.NullPointerException at liquibase.diff.compare.DatabaseObjectComparatorFactory.isSameObject(DatabaseObjectComparatorFactory.java:91) at liquibase.snapshot.DatabaseSnapshot.get(DatabaseSnapshot.java:180) at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:137) at liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFactory.java:87) at liquibase.snapshot.SnapshotGeneratorFactory.hasDatabaseChangeLogTable(SnapshotGeneratorFactory.java:160) at liquibase.database.AbstractJdbcDatabase.hasDatabaseChangeLogTable(AbstractJdbcDatabase.java:726) at liquibase.database.AbstractJdbcDatabase.getRanChangeSetList(AbstractJdbcDatabase.java:1127) at liquibase.database.AbstractJdbcDatabase.checkDatabaseChangeLogTable(AbstractJdbcDatabase.java:695) at liquibase.Liquibase.checkDatabaseChangeLogTable(Liquibase.java:602) at liquibase.Liquibase.update(Liquibase.java:130) at com.codahale.dropwizard.migrations.DbMigrateCommand.run(DbMigrateCommand.java:58) at com.codahale.dropwizard.migrations.DbCommand.run(DbCommand.java:51) at com.codahale.dropwizard.migrations.AbstractLiquibaseCommand.run(AbstractLiquibaseCommand.java:54) at com.codahale.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:62) at com.codahale.dropwizard.cli.Cli.run(Cli.java:69) at com.codahale.dropwizard.Application.run(Application.java:72) at com.example.helloworld.HelloWorldApplication.main(HelloWorldApplication.java:22) {code} I tracked this down to {{liquibase.diff}} (and after fixing that, {{liquibase.datatype}}) not being in the default packagesToScan list specified in {{liquibase.servicelocator.ServiceLocator}}. I changed the list to match the values in META-INF/MANIFEST.MF, and that got me going. I realize I could also fix it by specifying the {{liquibase.scan.packages}} system property, but it looks like the default packagesToScan list was in sync with the manifest at one point and should be updated. I'll submit a pull request with the change.

    JIRA | 4 years ago | Robert Rasmussen
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    While creating a converter for xom Documents to DatabaseChangeLogs, if the new DatabaseChangeLog is created using the default constructor, it will NPE. Workaround: Use the String constructor with an empty string. {noformat} INFO 3/9/15 6:03 PM: liquibase: Successfully acquired change log lock INFO 3/9/15 6:03 PM: liquibase: Reading from public.databasechangelog INFO 3/9/15 6:03 PM: liquibase: Successfully released change log lock Exception in thread "main" java.lang.NullPointerException at liquibase.changelog.filter.ShouldRunChangeSetFilter.normalizePath(ShouldRunChangeSetFilter.java:74) at liquibase.changelog.filter.ShouldRunChangeSetFilter.getPath(ShouldRunChangeSetFilter.java:69) at liquibase.changelog.filter.ShouldRunChangeSetFilter.pathsAreEqual(ShouldRunChangeSetFilter.java:56) at liquibase.changelog.filter.ShouldRunChangeSetFilter.changeSetsMatch(ShouldRunChangeSetFilter.java:42) at liquibase.changelog.filter.ShouldRunChangeSetFilter.accepts(ShouldRunChangeSetFilter.java:28) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:60) at liquibase.Liquibase.update(Liquibase.java:200) at liquibase.Liquibase.update(Liquibase.java:181) at com.ismobile.CheckXMLSubst.main(CheckXMLSubst.java:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) {noformat}

    JIRA | 2 years ago | Goran Lowkrantz
    java.lang.NullPointerException
  5. 0

    While creating a converter for xom Documents to DatabaseChangeLogs, if the new DatabaseChangeLog is created using the default constructor, it will NPE. Workaround: Use the String constructor with an empty string. {noformat} INFO 3/9/15 6:03 PM: liquibase: Successfully acquired change log lock INFO 3/9/15 6:03 PM: liquibase: Reading from public.databasechangelog INFO 3/9/15 6:03 PM: liquibase: Successfully released change log lock Exception in thread "main" java.lang.NullPointerException at liquibase.changelog.filter.ShouldRunChangeSetFilter.normalizePath(ShouldRunChangeSetFilter.java:74) at liquibase.changelog.filter.ShouldRunChangeSetFilter.getPath(ShouldRunChangeSetFilter.java:69) at liquibase.changelog.filter.ShouldRunChangeSetFilter.pathsAreEqual(ShouldRunChangeSetFilter.java:56) at liquibase.changelog.filter.ShouldRunChangeSetFilter.changeSetsMatch(ShouldRunChangeSetFilter.java:42) at liquibase.changelog.filter.ShouldRunChangeSetFilter.accepts(ShouldRunChangeSetFilter.java:28) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:60) at liquibase.Liquibase.update(Liquibase.java:200) at liquibase.Liquibase.update(Liquibase.java:181) at com.ismobile.CheckXMLSubst.main(CheckXMLSubst.java:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) {noformat}

    JIRA | 2 years ago | Goran Lowkrantz
    java.lang.NullPointerException

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at liquibase.diff.compare.DatabaseObjectComparatorFactory.isSameObject()
    2. Liquibase Core
      Liquibase.update
      1. liquibase.diff.compare.DatabaseObjectComparatorFactory.isSameObject(DatabaseObjectComparatorFactory.java:91)
      2. liquibase.snapshot.DatabaseSnapshot.get(DatabaseSnapshot.java:180)
      3. liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:137)
      4. liquibase.snapshot.SnapshotGeneratorFactory.has(SnapshotGeneratorFactory.java:87)
      5. liquibase.snapshot.SnapshotGeneratorFactory.hasDatabaseChangeLogTable(SnapshotGeneratorFactory.java:160)
      6. liquibase.database.AbstractJdbcDatabase.hasDatabaseChangeLogTable(AbstractJdbcDatabase.java:726)
      7. liquibase.database.AbstractJdbcDatabase.getRanChangeSetList(AbstractJdbcDatabase.java:1127)
      8. liquibase.database.AbstractJdbcDatabase.checkDatabaseChangeLogTable(AbstractJdbcDatabase.java:695)
      9. liquibase.Liquibase.checkDatabaseChangeLogTable(Liquibase.java:602)
      10. liquibase.Liquibase.update(Liquibase.java:130)
      10 frames
    3. com.codahale.dropwizard
      Application.run
      1. com.codahale.dropwizard.migrations.DbMigrateCommand.run(DbMigrateCommand.java:58)
      2. com.codahale.dropwizard.migrations.DbCommand.run(DbCommand.java:51)
      3. com.codahale.dropwizard.migrations.AbstractLiquibaseCommand.run(AbstractLiquibaseCommand.java:54)
      4. com.codahale.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:62)
      5. com.codahale.dropwizard.cli.Cli.run(Cli.java:69)
      6. com.codahale.dropwizard.Application.run(Application.java:72)
      6 frames
    4. com.example.helloworld
      HelloWorldApplication.main
      1. com.example.helloworld.HelloWorldApplication.main(HelloWorldApplication.java:22)
      1 frame