liquibase.exception.DatabaseException: java.lang.NullPointerException

JIRA | Rafael Chaves | 2 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    I have a change log using a sqlFile changeset, and I am finding various issues with comments. The one at hand: if a comment line ends with semicolon, it seems Liquibase will see it as a statement to execute. For instance, if my SQL file looks like this: {code} -- This one is ignored -- This too is ignored; as the semicolon is not the last character -- This is just a comment but Liquibase will try to execute it; CREATE TABLE MY_TABLE ( column1 VARCHAR(50)); {code} Liquibase will try to execute the three comments as a statement (I gather because it sees line-ending semi-colons as indication of statements): {code} DEBUG 1/27/15 6:55 PM: liquibase: changelog/db-changelog-master.xml: changelog/db-changelog-3.7-initial.xml::3.7_initial::pixeon: Executing EXECUTE database command: -- This one is ignored -- This too is ignored; as the semicolon is not the last character -- This is just a comment but Liquibase will try to execute it SEVERE 1/27/15 6:55 PM: liquibase: changelog/db-changelog-master.xml: changelog/db-changelog-3.7-initial.xml::3.7_initial::pixeon: Change Set changelog/db-changelog-3.7-initial.xml::3.7_initial::pixeon failed. Error: java.lang.NullPointerException liquibase.exception.DatabaseException: java.lang.NullPointerException at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1227) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1210) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:550) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73) at liquibase.Liquibase.update(Liquibase.java:200) at liquibase.integration.commandline.Main.doMigration(Main.java:1044) at liquibase.integration.commandline.Main.run(Main.java:175) at liquibase.integration.commandline.Main.main(Main.java:94) Caused by: java.lang.NullPointerException at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:973) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1041) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329) at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1909) at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871) at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:314) ... 11 more {code}

    JIRA | 2 years ago | Rafael Chaves
    liquibase.exception.DatabaseException: java.lang.NullPointerException
  2. 0

    I have a change log using a sqlFile changeset, and I am finding various issues with comments. The one at hand: if a comment line ends with semicolon, it seems Liquibase will see it as a statement to execute. For instance, if my SQL file looks like this: {code} -- This one is ignored -- This too is ignored; as the semicolon is not the last character -- This is just a comment but Liquibase will try to execute it; CREATE TABLE MY_TABLE ( column1 VARCHAR(50)); {code} Liquibase will try to execute the three comments as a statement (I gather because it sees line-ending semi-colons as indication of statements): {code} DEBUG 1/27/15 6:55 PM: liquibase: changelog/db-changelog-master.xml: changelog/db-changelog-3.7-initial.xml::3.7_initial::pixeon: Executing EXECUTE database command: -- This one is ignored -- This too is ignored; as the semicolon is not the last character -- This is just a comment but Liquibase will try to execute it SEVERE 1/27/15 6:55 PM: liquibase: changelog/db-changelog-master.xml: changelog/db-changelog-3.7-initial.xml::3.7_initial::pixeon: Change Set changelog/db-changelog-3.7-initial.xml::3.7_initial::pixeon failed. Error: java.lang.NullPointerException liquibase.exception.DatabaseException: java.lang.NullPointerException at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1227) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1210) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:550) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73) at liquibase.Liquibase.update(Liquibase.java:200) at liquibase.integration.commandline.Main.doMigration(Main.java:1044) at liquibase.integration.commandline.Main.run(Main.java:175) at liquibase.integration.commandline.Main.main(Main.java:94) Caused by: java.lang.NullPointerException at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:973) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1041) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329) at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1909) at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871) at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:314) ... 11 more {code}

    JIRA | 2 years ago | Rafael Chaves
    liquibase.exception.DatabaseException: java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    1 unregistered visitors

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at oracle.jdbc.driver.T4C8Oall.getNumRows()
    2. Oracle jdbc
      OracleStatementWrapper.execute
      1. oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:973)
      2. oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1041)
      3. oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
      4. oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1909)
      5. oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871)
      6. oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318)
      6 frames
    3. Liquibase Core
      Main.main
      1. liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:314)
      2. liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
      3. liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122)
      4. liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1227)
      5. liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1210)
      6. liquibase.changelog.ChangeSet.execute(ChangeSet.java:550)
      7. liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)
      8. liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
      9. liquibase.Liquibase.update(Liquibase.java:200)
      10. liquibase.integration.commandline.Main.doMigration(Main.java:1044)
      11. liquibase.integration.commandline.Main.run(Main.java:175)
      12. liquibase.integration.commandline.Main.main(Main.java:94)
      12 frames