Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

maven sql-maven-plugin & dbunit for HSQLDb

 
Shripad Umardand
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to populate in memory databse using sql-maven-plugin for creating table and dbunit plugin for populating database.
The following is pom.xml file.




I am getting the below exception.

[ERROR] Failed to execute goal org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3peration (insert) on project ebcp-beans: Error executing database operation: CLEAN_INSERT: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@28f4ff05[file =D:\BusinessPlatform\ebcp-project\ebcp\ebcp-beans\target\testdb.lck, exists=true, locked=false, valid=false, ] method: checkMagic reason: java.io.IOException: The process cannot access the file because another process has locked a portion of the file -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3peration (insert) on project ebcp-beans: Error executing database operation: CLEAN_INSERT
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing database operation: CLEAN_INSERT
at org.codehaus.mojo.dbunit.OperationMojo.execute(OperationMojo.java:109)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@28f4ff05[file =D:\BusinessPlatform\ebcp-project\ebcp\ebcp-beans\target\testdb.lck, exists=true, locked=false, valid=false, ] method: checkMagic reason: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
at org.codehaus.mojo.dbunit.AbstractDbUnitMojo.createConnection(AbstractDbUnitMojo.java:185)
at org.codehaus.mojo.dbunit.OperationMojo.execute(OperationMojo.java:92)
... 21 more
Caused by: org.hsqldb.HsqlException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@28f4ff05[file =D:\BusinessPlatform\ebcp-project\ebcp\ebcp-beans\target\testdb.lck, exists=true, locked=false, valid=false, ] method: checkMagic reason: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.persist.LockFile.newLockFileLock(Unknown Source)
at org.hsqldb.persist.Logger.acquireLock(Unknown Source)
at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
at org.hsqldb.Database.reopen(Unknown Source)
at org.hsqldb.Database.open(Unknown Source)
at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
at org.hsqldb.DatabaseManager.newSession(Unknown Source)
... 26 more
[ERROR]

Could anyone tell, what is going wrong and what should be URL for in memory database?
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!