Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/353.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java OrientDB';发动机&x27;远程';未找到';_Java_Orientdb_Orientdb2.2 - Fatal编程技术网

Java OrientDB';发动机&x27;远程';未找到';

Java OrientDB';发动机&x27;远程';未找到';,java,orientdb,orientdb2.2,Java,Orientdb,Orientdb2.2,Im使用面向社区的DB 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

Im使用面向社区的DB 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

您正在尝试用应用程序代码和OrientDB代码构建uberJar。要包含正确的依赖项,我的建议是从pom.xml分发版复制列表:

为什么它在IntelliJ中工作?IDE,甚至Eclipse,都有一个类路径,包括测试源和测试JAR。 当您使用maven构建时,它有一个与idea中相同的“测试”类路径,以及一个没有测试JAR的运行时类路径(并且没有测试JAR的可传递依赖关系!!!)

关于远程连接,您需要一个运行的独立OrientDB服务器来连接,或者至少您的应用程序应该运行嵌入式服务器


希望对您有所帮助。

您好,您可以在使用remote时发布部分代码吗?Thx-inadvance@MichelaBonizzi添加了thxi,在这部分代码中看不到“remote:xxxxxx/test1”。它是全部还是一个片段?@MichelaBonizzi AppConfig是一个静态类,在系统配置字符串中传递
AppConfig.getDatabaseConnectionString()
获取数据库连接字符串。在本例中,它是“remote:xxxxxx/test1”。数据库已存在,IntelliJ内部已建立连接。是否可以尝试添加面向库的DB服务器?
        <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>
public OrientGraphFactory factory() {

    final int THREADS = Runtime.getRuntime().availableProcessors() + 1;

    return new OrientGraphFactory(
        AppConfig.getDatabaseConnectionString(),
        AppConfig.getDatabaseUsername(),
        AppConfig.getDatabaseSecret()).setupPool(THREADS, THREADS + 10);

}