问题
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
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/28371268/orientdb-etl-throws-exception-on-loading-csv-file