2016-11-15 67 views
1

Im使用community orientdb 2.2.12。當我在IntelliJ內部運行應用程序時,一切正常。然而,當我編譯項目我得到以下錯誤:OrientDB'engine'remote'was found'

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 

POM:

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

} 
+0

嗨,你可以發佈代碼的一部分,當你使用遠程? Thx –

+0

@MichelaBonizzi added thx – tarka

+0

我看不到「remote:xxxxxx/test1」這部分代碼。這是全部還是隻是一個片段? –

回答

2

AFAIU你想建立一個uberJar與您的應用程序代碼和OrientDB代碼。要包含正確的依存關係,我的建議是到列表從分配的pom.xml複製:

https://github.com/orientechnologies/orientdb/blob/master/distribution/pom.xml

爲什麼它的IntelliJ工作?那麼,即使是Eclipse,IDE也只有一個類路徑,包括測試源和測試罐。 使用maven構建時,它有一個「test」類路徑,與想法中的一樣,並且沒有測試jar的運行時類路徑(並且沒有測試jar的傳遞依賴性!!!)。

關於遠程連接,您需要一個正在運行的獨立OrientDB服務器來連接,或者至少您的應用程序應運行嵌入式服務器。

希望得到這個幫助。