我正在使用community orientdb 2.2.12
. 当我在 IntelliJ 中运行应用程序时,一切正常。但是,当我编译项目时,出现以下错误:
Caused by: com.orientechnologies.orient.core.exception.OConfigurationException: Error on opening database: the engine 'remote' was not found. URL was: remote:xxxxxx/test1. Registered engines are: [memory, plocal]
DB name="remote:xxxxxx/test1"
at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:462)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.<init>(ODatabaseDocumentTx.java:171)
... 13 more
聚甲醛:
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-core</artifactId>
<version>${orientdb-version}</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-graphdb</artifactId>
<version>${orientdb-version}</version>
</dependency>
<dependency>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints-core</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-client</artifactId>
<version>${orientdb-version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
<artifactId>concurrentlinkedhashmap-lru</artifactId>
<version>1.4.2</version>
</dependency>
我检查了阴影 JAR,它包含所有orientdb-client-*
.
抛出异常的代码:
public OrientGraphFactory factory() {
final int THREADS = Runtime.getRuntime().availableProcessors() + 1;
return new OrientGraphFactory(
AppConfig.getDatabaseConnectionString(),
AppConfig.getDatabaseUsername(),
AppConfig.getDatabaseSecret()).setupPool(THREADS, THREADS + 10);
}