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

IllegalArgument when executing Flyway Ant build script several times in the same JVM #484

Closed
flyway opened this issue Jun 25, 2013 · 2 comments
Closed

Comments

@ghost
Copy link
Collaborator

@ghost ghost commented Jun 25, 2013

Original author: ggrussen...@gmail.com (May 03, 2013 14:01:52)

I have an Ant build script containing Flyway tasks and a main method wrapping the script's execution.
When the main method is executed several times by restarting the JVM, everything is fine and the tasks execute cleanly. But if the main method gets called several times within the same JVM, only the first invocation succeeds, the subsequent ones fails with the following error message: "java.lang.IllegalArgumentException: null source".

This message is the one of the following exception:
Caused by: java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(EventObject.java:38)
at org.apache.tools.ant.BuildEvent.<init>(BuildEvent.java:93)
at org.apache.tools.ant.Project.fireMessageLogged(Project.java:2351)
at org.apache.tools.ant.Project.log(Project.java:492)
at com.googlecode.flyway.ant.AntLog.debug(AntLog.java:42)
at com.googlecode.flyway.core.dbsupport.DbSupportFactory.createDbSupport(DbSupportFactory.java:59)
at com.googlecode.flyway.core.Flyway.execute(Flyway.java:1159)
at com.googlecode.flyway.core.Flyway.info(Flyway.java:967)
at com.googlecode.flyway.ant.MigrateTask.doExecuteWithMigrationConfig(MigrateTask.java:157)
at com.googlecode.flyway.ant.AbstractMigrationLoadingTask.doExecute(AbstractMigrationLoadingTask.java:271)
at com.googlecode.flyway.ant.AbstractFlywayTask.execute(AbstractFlywayTask.java:329)
... 33 more

Behaviour was observed with Flyway 2.1.1 and Ant 1.8.5.

Original issue: http://code.google.com/p/flyway/issues/detail?id=487

@ghost
Copy link
Collaborator Author

@ghost ghost commented Jun 25, 2013

From ggrussen...@gmail.com on May 03, 2013 14:06:25
The issue comes from the fact that the Project instance referenced by the AntLog instance referenced as the LOG static field of DbSupportFactory is not the Project instance being executed for invocations after the first one. As a consequence, it does not contain any threaded tasks and returns a null Task.

@ggrussenmeyer
Copy link

@ggrussenmeyer ggrussenmeyer commented Jun 25, 2013

+1

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

Successfully merging a pull request may close this issue.

None yet
1 participant