amazon-archives / dynamodb-janusgraph-storage-backend

The Amazon DynamoDB Storage Backend for JanusGraph
Apache License 2.0
446 stars 99 forks source link

trouble with connecting to dynamodb through Java #233

Open greghines opened 7 years ago

greghines commented 7 years ago

Hi - I have the following Java code which I am trying to use to have Janusgraph connect to the cloud dynamodb (as opposed to the local test version).

import org.apache.commons.configuration.BaseConfiguration; import com.amazon.janusgraph.diskstorage.dynamodb.DynamoDBStoreManager; import org.janusgraph.core.JanusGraphFactory; import org.janusgraph.core.JanusGraph; ..... BaseConfiguration conf = new BaseConfiguration(); conf.setProperty("storage.backend","com.amazon.janusgraph.diskstorage.dynamodb.DynamoDBStoreManager"); ....JanusGraph graph = JanusGraphFactory.open(conf);

The error I'm getting when trying to run is: "errorMessage": "Could not instantiate implementation: com.amazon.janusgraph.diskstorage.dynamodb.DynamoDBStoreManager", .... "errorType": "java.lang.NoClassDefFoundError",

Is this a bug or am I missing something? Thought importing com.amazon.janusgraph.diskstorage.dynamodb.DynamoDBStoreManager would be enough - I have dynamodb-janusgraph-storage-backend listed as a dependency in my pom.xml file so everything is compiling just fine.

I've found examples of how to use Gremlin with dynamodb/janusgraph but nothing about how to set things up purely in Java. An example would be greatly appreciated.

amcp commented 7 years ago

Can you please provide more context? is the version of the plugin you target in pom.xml available in Maven? Where are you executing this code? if you can point me to a repo on GitHub where you reproduce this issue consistently, that would be extremely helpful.

amcp commented 7 years ago

@greghines If the class is not found, it appears that you have not installed the DynamoDB Storage Backend dependencies in Gremlin server. Did you build the server zip with src/test/resources/install-gremlin-server.sh? Or did you use the vanilla server zip from janusgraph.org?