Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version NullPointerException when changelog table is empty #57

Closed
avs777 opened this issue Oct 14, 2016 · 2 comments
Closed

version NullPointerException when changelog table is empty #57

avs777 opened this issue Oct 14, 2016 · 2 comments

Comments

@avs777
Copy link

avs777 commented Oct 14, 2016

When executing migrate version command, NullPointerException is thrown if changlog table is empty. If I add any record to the table everything starts working fine.

mybatis-migrations-3.2.1
mysql-connector-java-5.1.39-bin.jar

migrate --env=ci version 20161014040630 --trace
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
------------------------------------------------------------------------
-- MyBatis Migrations - version
------------------------------------------------------------------------
Upgrading to: 20161014040630
------------------------------------------------------------------------
-- MyBatis Migrations FAILURE
-- Total time: 0s
-- Finished at: Thu Oct 13 21:09:04 PDT 2016
-- Final Memory: 17M/479M
------------------------------------------------------------------------


ERROR: java.lang.NullPointerExceptionorg.apache.ibatis.migration.MigrationException: java.lang.NullPointerException
        at org.apache.ibatis.migration.CommandLine.runCommand(CommandLine.java:71)
        at org.apache.ibatis.migration.CommandLine.execute(CommandLine.java:42)
        at org.apache.ibatis.migration.Migrator.main(Migrator.java:20)
Caused by: java.lang.NullPointerException
        at org.apache.ibatis.migration.operations.VersionOperation.operate(VersionOperation.java:49)
        at org.apache.ibatis.migration.commands.VersionCommand.execute(VersionCommand.java:35)
        at org.apache.ibatis.migration.CommandLine.runCommand(CommandLine.java:65)
        ... 2 more
@h3adache
Copy link
Member

@avs777 I'm sorry I'm confused how you got into the state where the changelog table was empty.
If you ran "down" steps until it was empty then it should have deleted the Changelog table in which cause version command would have told you there was no changelog?

Something like:

Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: CHANGELOG

@h3adache
Copy link
Member

@avs777 if you run into this again please give us steps to reproduce or, if you can, a sample project would be great. I can't reproduce your issue atm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants