amazon-archives / dynamodb-janusgraph-storage-backend

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

Error: Could not instantiate implementation: com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager #17

Closed atsuya046 closed 8 years ago

atsuya046 commented 8 years ago

I am trying to following here. On step 5, when I run g = TitanFactory.open(conf) on gremlin, it is failing Could not instantiate implementation: com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager. This is after succcessful mvn install and successeful running dynamodb-local with mvn test -Pstart-dynamodb-local command.

Here is the stack trace.

gremlin> conf = new BaseConfiguration()
==>org.apache.commons.configuration.BaseConfiguration@1922e6d
gremlin> conf.setProperty("storage.backend", "com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager")
==>null
gremlin> conf.setProperty("storage.dynamodb.client.endpoint", "http://localhost:4567")
==>null
gremlin> conf.setProperty("index.search.backend", "elasticsearch")
==>null
gremlin> conf.setProperty("index.search.directory", "/tmp/searchindex")
==>null
gremlin> conf.setProperty("index.search.elasticsearch.client-only", "false")
==>null
gremlin> conf.setProperty("index.search.elasticsearch.local-mode", "true")
==>null
gremlin> conf.setProperty("index.search.elasticsearch.interface", "NODE")
==>null
gremlin> g = TitanFactory.open(conf)
Could not instantiate implementation: com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager
Display stack trace? [yN] y
java.lang.IllegalArgumentException: Could not instantiate implementation: com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55)
    at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:421)
    at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:361)
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1275)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:93)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:73)
    at com.thinkaurelius.titan.core.TitanFactory$open.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at groovysh_evaluate.run(groovysh_evaluate:84)
    at groovysh_evaluate$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at groovysh_evaluate$run.call(Unknown Source)
    at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67)
    at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source)
    at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:152)
    at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114)
    at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source)
    at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:88)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
    at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:66)
    at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.<init>(Console.java:78)
    at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.<init>(Console.java:91)
    at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.main(Console.java:95)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44)
    ... 52 more
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.enable([Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/databind/ObjectMapper;
    at com.amazonaws.internal.config.InternalConfig.<clinit>(InternalConfig.java:43)
    at com.amazonaws.internal.config.InternalConfig$Factory.<clinit>(InternalConfig.java:304)
    at com.amazonaws.util.VersionInfoUtils.userAgent(VersionInfoUtils.java:139)
    at com.amazonaws.util.VersionInfoUtils.initializeUserAgent(VersionInfoUtils.java:134)
    at com.amazonaws.util.VersionInfoUtils.getUserAgent(VersionInfoUtils.java:95)
    at com.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:53)
    at com.amazon.titan.diskstorage.dynamodb.Constants.<clinit>(Constants.java:114)
    at com.amagremlin> zon.titan.diskstorage.dynamodb.DynamoDBStoreManager.getPort(DynamoDBStoreManager.java:66)
    at com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager.<init>(DynamoDBStoreManager.java:83)
    ... 57 more

I hope this helps. Thank you.

gmaxwell94 commented 8 years ago

I am getting the same error, following the instructions . t There are the following warnings [WARNING] Could not transfer metadata com.amazonaws:aws-java-sdk-dynamodb/maven-metadata.xml from/to maven-s3-release-repo (s3://dynamodblocal/release): Cannot access s3://dynamodblocal/release with type default using the available connector factories: BasicRepositoryConnectorFactory [WARNING] Could not transfer metadata com.amazonaws:aws-java-sdk-dynamodb/maven-metadata.xml from/to maven-s3-snapshot-repo (s3://dynamodblocal/snapshot): Cannot access s3://dynamodblocal/snapshot with type default using the available connector factories: BasicRepositoryConnectorFactory

Something about s3:// so not sure what you are looking for here. Thanks

sayrer commented 8 years ago

This is because the ObjectMapper.enable method used there requires Jackson 2.5+. I fixed this by editing the pom file for this.

atsuya046 commented 8 years ago

@sayrer Set jackson version 2.5.4, I fixed, too!! Thanks a lot :smiley_cat:

reterVision commented 8 years ago

@atsuya046 I'm still seeing this issue after I set jackson version to 2.5.4, is there anything I should fix too?

g12r commented 8 years ago

Same as reterVision. Having this issue with 2.5.4, 2.6.3. Never gets past this exception. Not a pathname issue per other thread, happening on osx with path /test.

brett--anderson commented 8 years ago

I'm getting the same error and stack trace as @atsuya046. I changed the pom.xml file, restarted everything, re-ran mvn install as well. Still getting the same error. OSX 10.9.5

danhodge commented 8 years ago

I was able to fix the issue by applying the change from https://github.com/awslabs/dynamodb-titan-storage-backend/issues/18, then:

<dependency>
    <groupId>com.thinkaurelius.titan</groupId>
    <artifactId>titan-core</artifactId>
    <version>${titan.version}</version>
    <exclusions>
        <exclusion>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
        </exclusion>
    </exclusions>
</dependency>
amcp commented 8 years ago

Dan Hodge, I was not able to verify your fix even when I follow your instructions. I have considered some workarounds and will update this thread when they are ready.

amcp commented 8 years ago

I have fixed the issue concerning jackson version and verified the fix with locally built server versions. See this commit: https://github.com/awslabs/dynamodb-titan-storage-backend/commit/87ed814daa9ca277bd3ef32f71232d03aaf173ca I will need to update the server zips for this fix, and I will close this issue when I do that. Meanwhile, you can change the local copies of your cloud formation scripts to point to a version of the server zip that you build and host locally.

amcp commented 8 years ago

I published new maven artifacts that include the fixed pom.

amcp commented 8 years ago

I deployed new artifact and confirmed that the new ZIP is available on S3. You can use the cloud formation template at the tip of 0.5.4 branch while the links in AWS docs get updated. Closing