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

NPE on customChange #5

Closed
vporoxnenko opened this issue Dec 19, 2015 · 3 comments
Closed

NPE on customChange #5

vporoxnenko opened this issue Dec 19, 2015 · 3 comments

Comments

@vporoxnenko
Copy link

I got an issue with customChange dsl

my changelog is pretty trivial

databaseChangeLog() {

changeSet(author: 'pupseg', id: 'test-1') {
customChange(class: 'my.VelocityTaskChange') {
param(name: 'param1', value: 'param1value')
}
}

public class VelocityTaskChange implements CustomTaskChange
do nothing right now

error on execution caused because customChange field is not initialized on liquibase validation stage and configureCustomChange() method called for null customChange object

liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: java.lang.NullPointerException
at liquibase.change.custom.CustomChangeWrapper.validate(CustomChangeWrapper.java:144)
at liquibase.changelog.visitor.ValidatingVisitor.visit(ValidatingVisitor.java:117)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:199)
at liquibase.Liquibase.update(Liquibase.java:206)
at liquibase.Liquibase.update(Liquibase.java:190)
at liquibase.integration.commandline.Main.doMigration(Main.java:1096)
at liquibase.integration.commandline.Main.run(Main.java:180)
at liquibase.integration.commandline.Main.main(Main.java:99)
Caused by: liquibase.exception.CustomChangeException: java.lang.NullPointerException
at liquibase.change.custom.CustomChangeWrapper.configureCustomChange(CustomChangeWrapper.java:253)
at liquibase.change.custom.CustomChangeWrapper.validate(CustomChangeWrapper.java:142)
... 8 more
Caused by: java.lang.NullPointerException
at liquibase.util.ObjectUtil.getMethods(ObjectUtil.java:136)
at liquibase.util.ObjectUtil.getWriteMethod(ObjectUtil.java:125)
at liquibase.util.ObjectUtil.setProperty(ObjectUtil.java:50)
at liquibase.change.custom.CustomChangeWrapper.configureCustomChange(CustomChangeWrapper.java:248)
... 9 more
liquibase.exception.ValidationFailedException: Validation Failed:
1 changes have validation errors
liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: java.lang.NullPointerException

    at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:206)
    at liquibase.Liquibase.update(Liquibase.java:206)
    at liquibase.Liquibase.update(Liquibase.java:190)
    at liquibase.integration.commandline.Main.doMigration(Main.java:1096)
    at liquibase.integration.commandline.Main.run(Main.java:180)
    at liquibase.integration.commandline.Main.main(Main.java:99)
@vporoxnenko
Copy link
Author

by the way groov-dsl is more compact and extensible than xml, thank you for yours job )

@vporoxnenko
Copy link
Author

just tested with xml
DatabaseChangeLog.load(...) method called before any kind of validation, so CustomChangeWrapper.customChange field will be implemented on validation phase

vporoxnenko pushed a commit to vporoxnenko/liquibase-groovy-dsl that referenced this issue Dec 19, 2015
stevesaliman added a commit that referenced this issue Dec 27, 2015
@stevesaliman
Copy link
Collaborator

Version 1.2.1, with Pull Request #6 has been published.

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