2

I am trying to load a simple CSV file to OrientDB and it always throws this exception.

CSV File Content

id, name, role
1, Sarath, Architect
2, Anoop, Project Manager
3, Nazeem, Lead Developer
4, Rini, Senior Developer
5, Shine, iOS Developer
6, Vishnu, iOS Developer

json config file

{
  "source": { "file": { "path": "./dev.csv" } },
  "extractor": { "row": {} },
  "transformers": [
    { 
      "csv": {}
    },
    { "vertex": { "class": "Person" } }
  ],

  "loader": {
    "orientdb": {
       "dbURL": "remote:localhost/dev",
       "dbType": "graph",
       "dbUser": "root",
       "dbPassword": "root",
       "dbAutoCreate": true,
       "classes": [
         {"name": "Person", "extends": "V"}
       ], "indexes": [
         {"class":"Person", "fields":["id:integer"], "type":"UNIQUE" }
       ]
    }
  }
}

All the time it shows this exception. I tried different CSV options but it did not work. Looks like the file reading itself throwing exception.

» oetl posts.json                                                                        sarat@Saraths-MacBook-Air
OrientDB etl v.2.0.1 (build @BUILD@) www.orientechnologies.com
Exception in thread "main" com.orientechnologies.orient.core.exception.OConfigurationException: Error on loading config file: posts.json
    at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.java:151)

Platform Details

OS X 10.10.2
java version "1.8.0_25"
OrientDB - v.2.0.1
sarat
  • 10,512
  • 7
  • 43
  • 74

2 Answers2

2

The stack trace gives you the cause of the problem (you only showed the first, not interesting lines in your example).

Check:

  • The server is running (you specified remote:localhost/dev, so the server must be running on the default port at the same machine).
  • The database exists and has "root" / "root" as credentials (note that mostly "admin" "admin" is used)
  • The file dev.csv is present in the current directory

Tried out your example and works without modification.

rmuller
  • 12,062
  • 4
  • 64
  • 92
  • 1
    I fixed it by specifying full path for JSON file 'oetl '. Looks like I need to set ORIENTDB_HOME to work without that. – sarat Feb 07 '15 at 02:33
  • mmm, strange. If I unset ORIENTDB_HOME it still works. What was the exact error message you got? – rmuller Feb 07 '15 at 07:32
0

I had the same problem, and it was due to one of the directories in the path to the JSON config file having a space in it. The oetl script doesn't handle this well and thus can't find the script.

@rmuller: The OP showed the entire traceback. That's all you get in this case.

Wayne
  • 933
  • 7
  • 11