orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.75k stars 871 forks source link

Sbt assembly: Error on opening database: the engine 'remote' was not found. #8255

Closed LianaN closed 3 years ago

LianaN commented 6 years ago

OrientDB Version: 2.2.2

Java Version: 8

OS: Centos

Expected behavior

should connect to the remote database.

Actual behavior

Error on opening database: the engine 'remote' was not found.

Steps to reproduce

val uri: String = "remote:XXX.XX.XX.XX/database/MYTEST"
val username: String = "root"
val password: String = "123"
val factory: OrientGraphFactory = new OrientGraphFactory(uri, username, password)
graph = factory.getTx

I use sbt in order to assembly a fat jar file. The orient..-client jar is included. However, I still get the error "Error on opening database: the engine 'remote' was not found".

This is an extract from build.sbt:

lazy val commonSettings = Seq(
  organization := "org.test",
  version := "0.1",
  scalaVersion := "2.11.8",
  assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = true),
  assemblyMergeStrategy in assembly := {
    case PathList("META-INF", xs @ _*) => MergeStrategy.discard
    case PathList("reference.conf") => MergeStrategy.concat
    case x => MergeStrategy.first
  }
)

val orientDBGraph = "com.orientechnologies" % "orientdb-graphdb" % "2.2.2"
//...

lazy val standalone = (project in file("./standalone"))
  .settings(
    commonSettings,
    libraryDependencies ++= Seq(sparkSQL, sparkGraphx, sparkMLLib,
      orientDBGraph, spingoCore, scalaHttp,
      spray, spingoCore, spingoPlayJson, spingoJson4s,
      spingoAirbrake, spingoAkkaStream, elasticSpark,
      jacksonScala,jacksonDataformat,jacksonCore,
      jacksonAnnotations,jacksonDatabind
    )
  )
dependencyOverrides += "com.typesafe.akka" %% "akka-stream" % akkaVersion
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.9"
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9"
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9"
dependencyOverrides += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.8.9"
dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-paranamer" % "2.8.9"
tglman commented 6 years ago

Hi @LianaN,

The remote engine is part of orientdb-client jar that should be include by the orientdb-graphdb ( the hierarchy is orientdb-graphdb -> orientdb-server -> orientdb-client) can you double check that the dependency is resolved correctly ?

Regards

wolf4ood commented 6 years ago

Hi @LianaN

if you are doing a single executable jar consider using a solution that support Resource append. With maven we advice this

https://orientdb.com/docs/last/Tutorial-Installation.html#building-a-single-executable-jar-with-orientdb

Thanks

LianaNapalkova commented 6 years ago

Hi @maggiolo00,

This link leads to a non-existing page. Could you please update it?

Thanks.

wolf4ood commented 6 years ago

Hi @LianaNapalkova

sorry here it's the working link

https://orientdb.com/docs/last/gettingstarted/Tutorial-Installation.html#building-a-single-executable-jar-with-orientdb