gpt4 book ai didi

hsqldb - 通过maven exec插件启动hsqldb服务器失败

转载 作者:行者123 更新时间:2023-12-04 22:24:14 24 4
gpt4 key购买 nike

我尝试启动 hsqldb 服务器以供开发使用。我有 hsqldb 依赖:

<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.4</version>
</dependency>

我在构建 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>

我启动 mvn exec:java,服务器启动,我有这个错误:
[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

我搜索了代码,这个错误意味着什么,我在 hsqldb 代码中发现了这个页面上的错误 => 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;
}

因此,hsqldb 将所有参数用作关键参数:“没有有效的数据库路径:maformed 数据库枚举器: server.database.0 mem:monitoring

所以它看起来像一个错误,还是我做错了什么?

好的,我找到了解决方案,我改变了给 exec maven 插件提供参数的方式。

由此 :
<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>

它有效

最佳答案

我改变了将参数传递给 exec maven 插件的方式

由此 :

<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>

它有效

关于hsqldb - 通过maven exec插件启动hsqldb服务器失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7767615/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com