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

NullPointerException migrating to "current" on empty DB #1302

Closed
gimmi opened this issue Apr 29, 2016 · 2 comments
Closed

NullPointerException migrating to "current" on empty DB #1302

gimmi opened this issue Apr 29, 2016 · 2 comments

Comments

@gimmi
Copy link

gimmi commented Apr 29, 2016

What version of Flyway are you using?
      <dependency>
         <groupId>org.flywaydb</groupId>
         <artifactId>flyway-core</artifactId>
         <version>4.0</version>
      </dependency>
What database are you using (type & version)?

MySQL

What operating system are you using?

Windows

What did you do?

(Please include the content causing the issue, any relevant configuration settings, and the command you ran)

On a freshly created, empty DB (even without schema_version) run the following:

Flyway flyway = new Flyway();
flyway.setDataSource(/* ... */);
flyway.setTargetAsString("current");
flyway.migrate();
What did you expect to see?

The database should be migrated to the latest version available in migrations scripts

What did you see instead?
java.lang.NullPointerException
    at org.flywaydb.core.internal.info.MigrationInfoServiceImpl.refresh(MigrationInfoServiceImpl.java:110)
    at org.flywaydb.core.internal.command.DbValidate$2.doInTransaction(DbValidate.java:156)
    at org.flywaydb.core.internal.command.DbValidate$2.doInTransaction(DbValidate.java:150)
    at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
    at org.flywaydb.core.internal.command.DbValidate.validate(DbValidate.java:150)
    at org.flywaydb.core.Flyway.doValidate(Flyway.java:994)
    at org.flywaydb.core.Flyway.access$100(Flyway.java:72)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:921)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:917)
    at org.flywaydb.core.Flyway.execute(Flyway.java:1361)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:917)
    ...
@axelfontaine
Copy link
Contributor

Good catch! Fixed.

axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue May 6, 2016
@gimmi
Copy link
Author

gimmi commented May 6, 2016

Thanks a lot!

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

No branches or pull requests

2 participants