sql task: execute script on lucid errors with NullPointerException
------------------------------------------------------------------
Key: MSQL-45
URL: http://jira.codehaus.org/browse/MSQL-45
Project: Maven 2.x SQL Plugin
Issue Type: Bug
Affects Versions: 1.3
Environment: ubuntu, java 1.6,
Reporter: Steve Etherington
Attachments: maven-sql.patch
The plugin throws an exception when executing an update script against Lucid.
(Fails for create table, drop table, and insert, at least.)
[INFO] Executing file: [...] create_table.sql
[ERROR] Failed to execute: CREATE TABLE [... my table]
[ERROR] java.sql.SQLException: java.lang.NullPointerException
at
de.simplicit.vjdbc.VirtualStatement.getResultSet(VirtualStatement.java:152)
at org.codehaus.mojo.sql.SqlExecMojo.execSQL(SqlExecMojo.java:817)
at org.codehaus.mojo.sql.SqlExecMojo.runStatements(SqlExecMojo.java:782)
at org.codehaus.mojo.sql.SqlExecMojo.access$200(SqlExecMojo.java:53)
at
org.codehaus.mojo.sql.SqlExecMojo$Transaction.runTransaction(SqlExecMojo.java:992)
at
org.codehaus.mojo.sql.SqlExecMojo$Transaction.access$100(SqlExecMojo.java:939)
at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:463)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
The problem seems to be an exact replica of this bug for ant sql exec:
https://issues.apache.org/bugzilla/show_bug.cgi?id=36265
I made a local patch of Maven Sql plugin using the fix in the ant sql bug
report and this solved the problem.
(The patch conforms to my local coding standards so unfortunately has lots of
trivial changes. You may prefer to make the change directly to the code
yourselves)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email