[ 
https://issues.apache.org/jira/browse/TINKERPOP-1047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15062512#comment-15062512
 ] 

Daniel Kuppitz commented on TINKERPOP-1047:
-------------------------------------------

Ah, I see, now it makes sense. {{gremlin.tinkergraph.vertexIdManager}} is good 
enough to work around this issue and I guess, if I ever run into this issue 
again, I will remember that there's an option. However, if you hit this problem 
the first time, it's hard to figure out what to do and thus a note in the docs 
would probably be a good idea.

> TinkerGraph GraphSON storage format broken
> ------------------------------------------
>
>                 Key: TINKERPOP-1047
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1047
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: io
>    Affects Versions: 3.0.2-incubating
>            Reporter: Daniel Kuppitz
>            Assignee: stephen mallette
>             Fix For: 3.1.1-incubating
>
>
> Opening a TinkerGraph, that is stored in GraphSON format, doesn't reset the 
> internal id counter.
> {noformat}
> gremlin> configuration = new BaseConfiguration()
> ==>org.apache.commons.configuration.BaseConfiguration@b8a7e43
> gremlin> configuration.setProperty(Graph.GRAPH, 
> "org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph")
> ==>null
> gremlin> configuration.setProperty("gremlin.tinkergraph.graphLocation", 
> "/tmp/graph.graphson")
> ==>null
> gremlin> configuration.setProperty("gremlin.tinkergraph.graphFormat", 
> "graphson")
> ==>null
> gremlin> mygraph = GraphFactory.open(configuration)
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> mygraph.addVertex()
> ==>v[0]
> gremlin> mygraph.close()
> ==>null
> gremlin> mygraph = GraphFactory.open(configuration)
> ==>tinkergraph[vertices:1 edges:0]
> gremlin> mygraph.addVertex()
> ==>v[0]
> gremlin> mygraph.close()
> ==>null
> gremlin> mygraph = GraphFactory.open(configuration)
> GraphFactory could not instantiate this Graph implementation [class 
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph]
> Display stack trace? [yN] y
> java.lang.RuntimeException: GraphFactory could not instantiate this Graph 
> implementation [class 
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph]
>       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.call(Unknown 
> Source)
>       at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122)
>       at groovysh_evaluate.run(groovysh_evaluate:3)
>       at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
>       at 
> org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:69)
>       at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:185)
>       at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:119)
>       at 
> org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:94)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
>       at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
>       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:324)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:123)
>       at 
> org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:58)
>       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:324)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:82)
>       at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
>       at 
> org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:144)
>       at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
>       at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:303)
> Caused by: java.lang.reflect.InvocationTargetException
>       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.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78)
>       ... 37 more
> Caused by: java.lang.RuntimeException: Could not load graph at 
> /tmp/graph.graphson with graphson
>       at 
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.loadGraph(TinkerGraph.java:289)
>       at 
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.<init>(TinkerGraph.java:157)
>       at 
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.open(TinkerGraph.java:186)
>       ... 42 more
> Caused by: java.lang.IllegalArgumentException: Vertex with id already exists: > 0
>       at 
> org.apache.tinkerpop.gremlin.structure.Graph$Exceptions.vertexWithIdAlreadyExists(Graph.java:1116)
>       at 
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.addVertex(TinkerGraph.java:199)
>       at 
> org.apache.tinkerpop.gremlin.structure.util.Attachable$Method.createVertex(Attachable.java:291)
>       at 
> org.apache.tinkerpop.gremlin.structure.util.Attachable$Method.lambda$create$20(Attachable.java:149)
>       at 
> org.apache.tinkerpop.gremlin.structure.util.Attachable.attach(Attachable.java:63)
>       at 
> org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader.lambda$readGraph$93(GraphSONReader.java:105)
>       at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
>       at 
> java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
>       at java.util.Iterator.forEachRemaining(Iterator.java:116)
>       at 
> java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
>       at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
>       at 
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
>       at 
> java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
>       at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
>       at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
>       at 
> java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
>       at 
> org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader.readGraph(GraphSONReader.java:103)
>       at 
> org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo.readGraph(GraphSONIo.java:86)
>       at 
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.loadGraph(TinkerGraph.java:282)
>       ... 44 more
> gremlin> 
> {noformat}
> I just discovered this bug in the current {{master/}}. Previous versions 
> might be affected as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to