This is not about registration, but about "prodDB.properties". You get a FileNotFoundException because it cannot write (or possibly rename) it. The user who launches the application should not have write permissions in the directory where he creates the HSQLDB database files.
The default configuration uses a relative path, so it records wherever the application starts:
production { dataSource { dbCreate = "update" url = "jdbc:hsqldb:file:prodDb;shutdown=true" } }
One fix is ββto hardcode the path in DataSource.groovy:
production { dataSource { dbCreate = "update" url = "jdbc:hsqldb:file:/some/writeable/folder/prodDb;shutdown=true" } }
It is best to include external configuration files in Config.groovy:
grails.config.locations = ["classpath:${appName}-config.groovy"]
and create foo-config.groovy containing
dataSource { url = "jdbc:hsqldb:file:/some/writeable/folder/prodDb;shutdown=true" }
and put foo-config.groovy in $ TOMCAT_HOME / lib, which is in the Tomcat path (change foo to your application name). Thus, you can deploy the war in several places and simply override the configuration file, rather than hard-coded a single value in Config.groovy.
Burt beckwith
source share