java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean

JIRA | Rubén Lagar | 3 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

    When trying to obtain a diffChangeLog between 2 schemas like ./liquibase.sh --logLevel=debug --driver=com.mysql.jdbc.Driver --changeLogFile=../diffLabs.xml --url=jdbc:mysql://127.0.0.1:3306/lab1 --username=root --password=xxxxxxx diffChangeLog --referenceUrl=jdbc:mysql://127.0.0.1:3306/lab2 --referenceUsername=root --referencePassword=xxxxxxx I am getting a casting error {noformat} Liquibase diffChangeLog Failed: java.lang.Integer cannot be cast to java.lang.Boolean SEVERE 12/2/13 7:15 AM:liquibase: java.lang.Integer cannot be cast to java.lang.Boolean java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean at liquibase.datatype.core.BooleanType.objectToSql(BooleanType.java:75) at liquibase.diff.output.changelog.core.MissingColumnChangeGenerator.fixMissing(MissingColumnChangeGenerator.java:72) at liquibase.diff.output.changelog.ChangeGeneratorChain.fixMissing(ChangeGeneratorChain.java:44) at liquibase.diff.output.changelog.ChangeGeneratorFactory.fixMissing(ChangeGeneratorFactory.java:95) at liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:140) at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:121) at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:67) at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:50) at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:153) at liquibase.integration.commandline.Main.doMigration(Main.java:788) at liquibase.integration.commandline.Main.main(Main.java:133) {noformat} Looks like it is trying to add a new column and mixing up Integers and Booleans.

    JIRA | 3 years ago | Rubén Lagar
    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean
  2. 0

    When trying to obtain a diffChangeLog between 2 schemas like ./liquibase.sh --logLevel=debug --driver=com.mysql.jdbc.Driver --changeLogFile=../diffLabs.xml --url=jdbc:mysql://127.0.0.1:3306/lab1 --username=root --password=xxxxxxx diffChangeLog --referenceUrl=jdbc:mysql://127.0.0.1:3306/lab2 --referenceUsername=root --referencePassword=xxxxxxx I am getting a casting error {noformat} Liquibase diffChangeLog Failed: java.lang.Integer cannot be cast to java.lang.Boolean SEVERE 12/2/13 7:15 AM:liquibase: java.lang.Integer cannot be cast to java.lang.Boolean java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean at liquibase.datatype.core.BooleanType.objectToSql(BooleanType.java:75) at liquibase.diff.output.changelog.core.MissingColumnChangeGenerator.fixMissing(MissingColumnChangeGenerator.java:72) at liquibase.diff.output.changelog.ChangeGeneratorChain.fixMissing(ChangeGeneratorChain.java:44) at liquibase.diff.output.changelog.ChangeGeneratorFactory.fixMissing(ChangeGeneratorFactory.java:95) at liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:140) at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:121) at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:67) at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:50) at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:153) at liquibase.integration.commandline.Main.doMigration(Main.java:788) at liquibase.integration.commandline.Main.main(Main.java:133) {noformat} Looks like it is trying to add a new column and mixing up Integers and Booleans.

    JIRA | 3 years ago | Rubén Lagar
    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.lang.Integer cannot be cast to java.lang.Boolean

      at liquibase.datatype.core.BooleanType.objectToSql()
    2. Liquibase Core
      Main.main
      1. liquibase.datatype.core.BooleanType.objectToSql(BooleanType.java:75)
      2. liquibase.diff.output.changelog.core.MissingColumnChangeGenerator.fixMissing(MissingColumnChangeGenerator.java:72)
      3. liquibase.diff.output.changelog.ChangeGeneratorChain.fixMissing(ChangeGeneratorChain.java:44)
      4. liquibase.diff.output.changelog.ChangeGeneratorFactory.fixMissing(ChangeGeneratorFactory.java:95)
      5. liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:140)
      6. liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:121)
      7. liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:67)
      8. liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:50)
      9. liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:153)
      10. liquibase.integration.commandline.Main.doMigration(Main.java:788)
      11. liquibase.integration.commandline.Main.main(Main.java:133)
      11 frames