0

I tried to connect using orientdb database with java. like this OrientGraph odb = new OrientGraph("plocal:C:/Users/USER/Desktop/orientdb/databases/testJ", "admin", "admin");

Its showing an error

HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/orientechnologies/orient/core/db/record/ODatabaseRecord

My dependencies..

    <dependency>
        <groupId>com.orientechnologies</groupId>
        <artifactId>orientdb-core</artifactId>
        <version>2.0.8</version>
    </dependency>
    <dependency>
      <groupId>com.orientechnologies</groupId>
      <artifactId>orientdb-jdbc</artifactId>
      <version>1.7</version>
    </dependency>
    <dependency>
      <groupId>com.tinkerpop</groupId>
      <artifactId>pipes</artifactId>
      <version>2.4.0</version>
    </dependency>
    <dependency>
       <groupId>com.tinkerpop.blueprints</groupId>
       <artifactId>blueprints-core</artifactId>
       <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>com.tinkerpop.blueprints</groupId>
        <artifactId>blueprints-orient-graph</artifactId>
        <version>2.4.0</version>
    </dependency>

help me to resolve the error.. thank you in advance

Riyas PK
  • 3,147
  • 1
  • 23
  • 29
  • Try `"file:///Users/...."` – Thilo May 18 '15 at 07:16
  • this answer might help if you have created the database in correct way:http://stackoverflow.com/a/22893008/2841481 and http://stackoverflow.com/a/26846163/2841481 – Ishan Rastogi May 18 '15 at 07:18
  • `"file:///Users/...."` not working. it showing. HTTP Status 500 - Request processing failed; nested exception is com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database – Riyas PK May 18 '15 at 07:36
  • @RiyasPK Why did you unaccepted the answer? Anything wrong. – CuriousMind May 23 '15 at 04:13

1 Answers1

1

The ODatabaseRecord seems to be deprecated from new version. I made following changes to your code and it worked (remove all other dependencies).

pom

<dependency>
  <groupId>com.orientechnologies</groupId>
  <artifactId>orientdb-core</artifactId>
  <version>2.0.8</version>
</dependency>
<dependency>
  <groupId>com.orientechnologies</groupId>
  <artifactId>orientdb-jdbc</artifactId>
  <version>2.0.8</version>
</dependency>

Java Code

OrientGraphFactory ogf = new OrientGraphFactory(
            "plocal:C:/Users/USER/Desktop/orientdb/databases/testJ", "admin", "admin");
    OrientGraph og = ogf.getTx();

    try {
        System.out.println("Features = " + og.getFeatures());
    } finally {
        og.shutdown();
    }

Note: I found clue here.

CuriousMind
  • 3,143
  • 3
  • 29
  • 54
  • I got problems using your code. It is just not working. I am using "root" "root" as login data. Why do you use admin ? –  Oct 07 '15 at 12:02
  • @FlorianNeiss I used `admin` because thats the default user for orientdb. Check details [here](http://orientdb.com/docs/2.0/orientdb.wiki/Security.html). – CuriousMind Oct 07 '15 at 13:06
  • @FlorianNeiss Actually the `admin` is used for the `plocal` connections, while `root` for `remote` connections. – Zsolti Sep 05 '18 at 12:07