I am trying to start the hsqldb server for use for development purposes. I had a hsqldb dependency:
<dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>2.2.4</version> </dependency>
I had a built-in exec-maven-build:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <executions> <execution> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <mainClass>org.hsqldb.server.Server</mainClass> <arguments> <argument>--database.0 file:target/monitoring</argument> </arguments> </configuration> </plugin>
And I run mvn exec: java, the server starts, and I have this error:
[ Server@6e9770a3 ]: [Thread[org.hsqldb.server.Server.main(),5,org.hsqldb.server.Server]]: Failed to set properties org.hsqldb.HsqlException: no valid database paths: maformed database enumerator: server.database.0 mem:monitoring
I am looking through the code what this error means, and I found the error code in hsqldb on this page => http://hsqldb.svn.sourceforge.net/viewvc/hsqldb/base/tags/2.2.5/src/org/hsqldb /server/Server.java?revision=4369&view=markup
private IntKeyHashMap getDBNameArray() { final String prefix = ServerProperties.sc_key_dbname + "."; final int prefixLen = prefix.length(); IntKeyHashMap idToAliasMap = new IntKeyHashMap(); Enumeration en = serverProperties.propertyNames(); for (; en.hasMoreElements(); ) { String key = (String) en.nextElement(); if (!key.startsWith(prefix)) { continue; } int dbNumber; try { dbNumber = Integer.parseInt(key.substring(prefixLen)); } catch (NumberFormatException e1) { **printWithThread("maformed database enumerator: " + key);** continue; } String alias = serverProperties.getProperty(key).toLowerCase(); if (!aliasSet.add(alias)) { printWithThread("duplicate alias: " + alias); } Object existing = idToAliasMap.put(dbNumber, alias); if (existing != null) { printWithThread("duplicate database enumerator: " + key); } } return idToAliasMap; }
So hsqldb uses the whole argument as a key: "There are no valid database paths: database enumerator: server.database.0 mem: monitoring "
So this seems like a mistake, or did I do something wrong?
OK, I found a solution, I changed the way I provide the arguments for the exec maven plugin.
from this:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <executions> <execution> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <mainClass>org.hsqldb.server.Server</mainClass> <arguments> <argument>--database.0 file:target/monitoring</argument> </arguments> </configuration> </plugin>
:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <executions> <execution> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <mainClass>org.hsqldb.server.Server</mainClass> <arguments> <argument>--database.0</argument> <argument>file:target/monitoring</argument> </arguments> </configuration> </plugin>
And he works