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

teleporter with conf error #7821

Closed
zygift opened this issue Oct 16, 2017 · 2 comments
Closed

teleporter with conf error #7821

zygift opened this issue Oct 16, 2017 · 2 comments
Assignees

Comments

@zygift
Copy link

zygift commented Oct 16, 2017

OrientDB Version: 2.2.27

Java Version: 1.8.0_121

OS: CentOS7

Expected behavior

Import relational database into OrientDB with the Teleporter using conf parameter.

Actual behavior

I used Teleporter through the script, as follows:
sh oteleporter.sh -jdriver Oracle -jurl jdbc:oracle:thin:@192.168.xxx.xxx:1521:orcl -juser root -jpasswd root -ourl plocal:/opt/orientdb-enterprise-2.2.27/databases/testdb -include ACTOR,FILM,ACTOR_FILM -s naive -nr original -v 2 -conf /opt/data/teleporter-config/migration-config.json

migration-config.json file:
{
"edges": [{
"Performs": {
"mapping": {
"fromTable": "ACTOR",
"fromColumns": ["ID"],
"toTable": "FILM",
"toColumns": ["ID"],
"joinTable": {
"tableName": "ACTOR_FILM",
"fromColumns": ["ACTOR_ID"],
"toColumns": ["FILM_ID"]
},
"direction": "direct"
},
"properties": {
"PAYMENT": {
"type": "STRING",
"mandatory": false,
"readOnly": false,
"notNull": false
}
}
}
}]
}

Steps to reproduce

Exception in thread "main" java.lang.NullPointerException
at com.orientechnologies.teleporter.context.OTeleporterContext.printExceptionMessage(OTeleporterContext.java:152)
at com.orientechnologies.teleporter.util.OMigrationConfigManager.loadMigrationConfigFromFile(OMigrationConfigManager.java:64)
at com.orientechnologies.teleporter.main.OTeleporter.execute(OTeleporter.java:250)
at com.orientechnologies.teleporter.main.OTeleporter.main(OTeleporter.java:219)

Is the import configuration file any problem?

@Johan-Tornborg
Copy link

#7929 - Same issue with configuration file.

@Kyserbyte
Copy link

Having the same problems, i have taken a look on the code of teleporter tool and I found a couple of issues.
First of all you need to have a config JSON file with this format, otherwise the script will crash:

{
    "vertices": [],
     "edges": [{
        "EDGE_NAME": {
            "mapping": [{
                "fromTable": "FROMTABLE",
                "fromColumns": ["ID"],
                "toTable": "TOTABLE",
                "toColumns": ["ID"],
                "direction": "EDGE_DIRECTION"
            }],
            "properties": {
            }
        }
    }]
}

You need to have an entry for "vertices" and the "mapping" property must to be an array of object and not an object.

After that, there is a bug on the config file loader method (OMigrationConfigManager.loadMigrationConfigFromFile) that attempt to use a singleton class (OTeleporterContext.getInstance) that is not initialized when is used. I will submit a pull request with a fix for that.

N.B: This is valid for the 3.0.1 version of OrientDB and Teleporter. I did not check other versions.

@laa laa closed this as completed Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants