Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import from JSON throws NPE #7119

Closed
4 tasks
paulgentry opened this issue Jan 24, 2017 · 1 comment
Closed
4 tasks

Import from JSON throws NPE #7119

paulgentry opened this issue Jan 24, 2017 · 1 comment
Assignees
Milestone

Comments

@paulgentry
Copy link

OrientDB Version, operating system, or hardware.

  • v2.2.15

Operating System

  • Linux
  • MacOSX
  • [x ] Windows
  • Other Unix
  • Other, name?

Expected behavior and actual behavior

Trying to import data from JSON, just using the example in the docs (Administration --> ETL --> Import from JSON) throws Null Pointer Exception with no helpful error message (at least nothing helpful to me unless I looked at the source code). No database is created (and of course nothing is imported).

Steps to reproduce the problem

json source (%ORIENTDB_HOME%/temp/accounts.json):
[ { "name": "Joe", "id": 1, "friends": [2,4,5], "enemies": [6] }, { "name": "Suzie", "id": 2, "friends": [1,4,6], "enemies": [5,2] } ]

import config source (%ORIENTDB_HOME%/temp/import_accounts.json):
{ "config": { "log": "debug" }, "source" : { "file": { "path": "../temp/accounts.json" } }, "extractor" : { "json": {} }, "transformers" : [ { "merge": { "joinFieldName": "id", "lookup": "Account.id" } }, { "vertex": { "class": "Account"} }, { "edge": { "class": "Friend", "joinFieldName": "friends", "lookup": "Account.id", "unresolvedLinkAction": "CREATE" } }, { "edge": { "class": "Enemy", "joinFieldName": "enemies", "lookup": "Account.id", "unresolvedLinkAction": "CREATE" } } ], "loader" : { "orientdb": { "dbURL": "plocal:../databases/db", "dbUser": "admin", "dbPassword": "admin", "dbAutoDropIfExists": true, "dbAutoCreate": true, "standardElementConstraints": false, "tx": false, "wal": false, "batchCommit": 1000, "dbType": "graph", "classes": [{"name": "Account", "extends":"V"}, {"name": "Friend", "extends":"E"}, {"name": 'Enemy', "extends":"E"}], "indexes": [{"class":"Account", "fields":["id:integer"], "type":"UNIQUE_HASH_INDEX" }] } } }

from the OrientDB bin directory, issue the command:
oetl.bat ..\temp\import_accounts.json

Result:
C:\Development\orientdb-community-2.2.15\bin>oetl.bat ..\temp\import_accounts.json OrientDB etl v.2.2.15 (build 2.2.x@rebf7b80c08613e871633edeb39c5c985e26b176c; 2017-01-19 07:39:00+0000) www.orientdb.com [orientdb] INFO Dropping existent database 'plocal:../databases/db'... Exception in thread "main" com.orientechnologies.orient.core.exception.OConfigurationException: Error on creating ETL processor DB name="plocal:../databases/db" at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.java:237) at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.java:177) at com.orientechnologies.orient.etl.OETLProcessor.parseConfigAndParameters(OETLProcessor.java:145) at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.java:109) Caused by: java.lang.NullPointerException at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.get(ODatabaseDocumentTx.java:1535) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.readDatabaseConfiguration(OrientBaseGraph.java:1915) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:150) at com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx.<init>(OrientGraphNoTx.java:62) at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory$2.getGraph(OrientGraphFactory.java:116) at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getNoTx(OrientGraphFactory.java:240) at com.orientechnologies.orient.etl.loader.OOrientDBLoader.configureGraphDB(OOrientDBLoader.java:407) at com.orientechnologies.orient.etl.loader.OOrientDBLoader.configure(OOrientDBLoader.java:345) at com.orientechnologies.orient.etl.OETLProcessor.configureComponent(OETLProcessor.java:476) at com.orientechnologies.orient.etl.OETLProcessor.configureLoader(OETLProcessor.java:289) at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.java:221) ... 3 more C:\Development\orientdb-community-2.2.15\bin>

Notes:
There is no database named "db" in the databases folder.
Just FYI, because even this simple example doesn't work, I can't import our actual JSON data so OrientDB is out of consideration for our new product. Ah well.

@lvca lvca added the bug label Jan 25, 2017
@lvca lvca added this to the 2.2.x (next hotfix) milestone Jan 25, 2017
@robfrank
Copy link
Contributor

hi, this is a duplicate of #7109 , so same recommendation, use a new 2.2.16 snapshot instead of etl 2.2.15 (or wait for next release). If you prefer to stay on 2.2.15, avoid: "dbAutoDropIfExists": true,

https://oss.sonatype.org/content/repositories/snapshots/com/orientechnologies/orientdb-etl/2.2.16-SNAPSHOT/

@robfrank robfrank modified the milestones: 2.2.x (next hotfix), 2.2.16 Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants