amazon-archives / dynamodb-janusgraph-storage-backend

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

Cloud Formation yaml file installs java 9 #240

Closed nicofo closed 7 years ago

nicofo commented 7 years ago

I installed the gremlin server with the Cloud Formation dynamodb-janusgraph-storage-backend-cfn.yaml file and when I run the gremlin console it can't find the graph.

I saw that java 9 was installed in EC2 instance. So i changed from dynamodb-janusgraph-storage-backend-cfn.yaml sdk install java < /dev/null to sdk install java 8u144-zulu < /dev/null . https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/2b13e0c93dd2f3cd3c1e295ad4db82073ebd28b1/dynamodb-janusgraph-storage-backend-cfn.yaml#L505

And now it works fine.

Is it the correct solution? Or Is there a better solution?

adilosa commented 7 years ago

I got this error when using Java 9:

java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class org.janusgraph.core.JanusGraphFactory]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:104)
        at org.apache.tinkerpop.gremlin.server.GraphManager.lambda$new$0(GraphManager.java:55)
        at java.base/java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:671)
        at org.apache.tinkerpop.gremlin.server.GraphManager.<init>(GraphManager.java:53)
        at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:83)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:110)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:344)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78)
        ... 8 more
Caused by: org.janusgraph.core.JanusGraphException: Could not execute operation due to backend exception
        at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:57)
        at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:159)
        at org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration.get(KCVSConfiguration.java:100)
        at org.janusgraph.diskstorage.configuration.BasicConfiguration.isFrozen(BasicConfiguration.java:106)
        at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1371)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:107)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:87)
        ... 13 more
Caused by: org.janusgraph.diskstorage.PermanentBackendException: Permanent exception while executing backend operation getConfiguration
        at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:82)
        at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:55)
        ... 19 more
Caused by: java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/janusgraph/diskstorage/StaticBuffer. Method lambda$static$0([BII)[B at index 105 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
        at org.janusgraph.diskstorage.StaticBuffer.<clinit>(StaticBuffer.java:79)
        at org.janusgraph.diskstorage.util.StaticArrayBuffer.asByteBuffer(StaticArrayBuffer.java:141)
        at com.amazon.janusgraph.diskstorage.dynamodb.AbstractDynamoDbStore.encodeKeyForLog(AbstractDynamoDbStore.java:185)
        at com.amazon.janusgraph.diskstorage.dynamodb.AbstractDynamoDbStore.encodeForLog(AbstractDynamoDbStore.java:236)
        org.janusgraph.diskstorage.util.StaticArrayBuffer.asByteBufferat org.janusgraph.diskstorage.util.MetricInstrumentedStore$1.call(MetricInstrumentedStore.java:106)

Switching to java 8u144-zulu seems to cause the gremlin-server to hang at startup.

adilosa commented 7 years ago

That exception may actually be related to using the Single-Item Model template without setting the relevant configuration in dynamodb.properties as discussed here: https://bricaud.github.io/personal-blog/janusgraph-running-on-aws-with-dynamodb/

Got it working with java 8u144-zulu and the Multi-Item Model template. Haven't tried Java 9 again.

amcp commented 7 years ago

@adilosa SDKMAN does not vend the latest openjdk version on the 1.8 track. I will revert to using the openjdk vended through AL yum.

amcp commented 7 years ago

Fixed in #245