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

stephen mallette commented on TINKERPOP-2292:
---------------------------------------------

I don't see a problem here - explanations for each error below:

{code}
jesse@vader ~$ gremlin
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 
(file:/home/jesse/src/apache-tinkerpop-gremlin-console-3.4.3/lib/groovy-2.5.7-indy.jar)
 to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of 
org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release
{code}

I assume you are using Java 9 or later - I think it produces those warnings in 
relation to Groovy: 
https://stackoverflow.com/questions/46454995/how-to-hide-warning-illegal-reflective-access-in-java-9-without-jvm-argument

{code}
\,,,/
 (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> g
No such property: g for class: groovysh_evaluate
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> g = graph.traversal()
No such property: graph for class: groovysh_evaluate
Type ':help' or ':h' for help.
Display stack trace? [yN]graph = TinkerGraph.open()
{code}

The above errors are expected. The console session has no knowledge of those 
variables. They don't exist yet because you haven't created them and therefore 
you get errors if you try to reference them on their own.

{code}
gremlin> graph = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> g = graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
{code}

Now that you've created them - you are able to reference "graph" and "g" - good 
to go.

{code}
gremlin> v1 = g.addV("person").property(id, 1).property("name", 
"marko").property("name", 29).next()
==>v[1]
gremlin> v1
==>v[1]
gremlin> v1.propert
properties( property(
{code}

I'm not sure why you didn't get an error above - obviously that little blob of 
syntax is incorrect. I would have expected something like:

{code}
gremlin> v1.propert
No such property: propert for class: 
org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex
Type ':help' or ':h' for help.
Display stack trace? [yN]properties( property( n

{code}

but perhaps that is just an error in what you pasted in the issue??
{code}
gremlin> v1.properties()
==>vp[name->marko]
==>vp[name->29]
gremlin> v1.property('name', 'foo')
==>vp[name->foo]
gremlin> v1.properties()
==>vp[name->foo]
gremlin> v1.property(list, 'name', 'foo')
==>vp[name->foo]
gremlin> v1.properties()
==>vp[name->foo]
==>vp[name->foo]
gremlin> v1.property(list, 'name', 'foos')
==>vp[name->foos]
gremlin> v1.property(set, 'name', 'foos')
==>vp[name->foos]
gremlin> v1.property(set, 'name', 'foo')
==>vp[name->foo]
gremlin> v1.propert
properties( property( 
{code}

More of the same broken code - not sure what's wrong there.

{code}
gremlin> v1.properties()
==>vp[name->foo]
==>vp[name->foo]
==>vp[name->foos]
gremlin> v1.property('name', 'foo')
==>vp[name->foo]
gremlin> v1.property(set, 'name', 'foo')
==>vp[name->foo]
gremlin> v1.properties()
==>vp[name->foo]
gremlin> v1 = g.addV("person").property(id, 1).property("name", 
"marko").property("age", 29).next()
Vertex with id already exists: 1
Type ':help' or ':h' for help.
Display stack trace? [yN]
{code}

Clearly an error - trying to create a new vertex with the same identifier.

{code}
gremlin> gremlin> v2 = g.addV("software").property(id, 3).property("name", 
"lop").property("lang", "java").next()
java.lang.NullPointerException
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> gremlin> v2 = g.addV("software").property(id, 3).property("name", 
"lop").property("lang", "java").next()
java.lang.NullPointerException
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> gremlin> v2 = g.addV("software").property(id, 3).property("name", 
"lop").property("lang", "java").next()
java.lang.NullPointerException
Type ':help' or ':h' for help.
Display stack trace? [yN]y
java.lang.NullPointerException
 at 
java.base/java.util.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1111)
 at 
java.base/java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1102)
 at 
org.codehaus.groovy.runtime.memoize.UnlimitedConcurrentCache.remove(UnlimitedConcurrentCache.java:70)
 at 
groovy.lang.GroovyClassLoader.removeClassCacheEntry(GroovyClassLoader.java:676)
 at jdk.internal.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
 at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 at 
org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
 at 
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:211)
 at 
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
 at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:98)
 at org.codehaus.groovy.tools.shell.Evaluator$evaluate.call(Unknown Source)
 at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:201)
 at 
org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
 at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
 at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
 at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
 at 
org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:83)
 at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:120)
 at org.codehaus.groovy.tools.shell.Shell$leftShift$1.call(Unknown Source)
 at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:93)
 at 
org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
 at jdk.internal.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
 at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
 at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
 at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:164)
 at 
org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:138)
 at jdk.internal.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
 at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 at 
org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
 at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
 at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:160)
 at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
 at 
org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
 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:566)
 at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
 at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
 at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:164)
 at 
org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:97)
 at 
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:234)
 at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:168)
 at 
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:234)
 at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:502)
gremlin>
{code}

Can't say what happened above except that every command issued to the console 
has a "gremlin> " prefixed to it so the syntax is invalid. I'd have expected a 
different error but it's invalid nonetheless. By this point, there have been so 
many errors it's hard to know what is triggering what problem. If there really 
is a bug here somewhere I think you will need to provide more information with 
a cleaner Gremlin Console session for us to try to solve it. Thanks.

> NullPointerException in console.
> --------------------------------
>
>                 Key: TINKERPOP-2292
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2292
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: console
>    Affects Versions: 3.4.3
>         Environment: Ubuntu 18.04
>            Reporter: Jesse Brennan
>            Priority: Minor
>
> I'm new to TinkerPop so it's very possible I was doing something wrong, but 
> here is the log of what happened to produce the error.
>  
> {code}
> jesse@vader ~$ gremlin
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 
> (file:/home/jesse/src/apache-tinkerpop-gremlin-console-3.4.3/lib/groovy-2.5.7-indy.jar)
>  to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
> WARNING: Please consider reporting this to the maintainers of 
> org.codehaus.groovy.vmplugin.v7.Java7$1
> WARNING: Use --illegal-access=warn to enable warnings of further illegal 
> reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> \,,,/
>  (o o)
> -----oOOo-(3)-oOOo-----
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> gremlin> g
> No such property: g for class: groovysh_evaluate
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> gremlin> g = graph.traversal()
> No such property: graph for class: groovysh_evaluate
> Type ':help' or ':h' for help.
> Display stack trace? [yN]graph = TinkerGraph.open()
> gremlin> graph = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> g = graph.traversal()
> ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
> gremlin> v1 = g.addV("person").property(id, 1).property("name", 
> "marko").property("name", 29).next()
> ==>v[1]
> gremlin> v1
> ==>v[1]
> gremlin> v1.propert
> properties( property( 
> gremlin> v1.properties()
> ==>vp[name->marko]
> ==>vp[name->29]
> gremlin> v1.property('name', 'foo')
> ==>vp[name->foo]
> gremlin> v1.properties()
> ==>vp[name->foo]
> gremlin> v1.property(list, 'name', 'foo')
> ==>vp[name->foo]
> gremlin> v1.properties()
> ==>vp[name->foo]
> ==>vp[name->foo]
> gremlin> v1.property(list, 'name', 'foos')
> ==>vp[name->foos]
> gremlin> v1.property(set, 'name', 'foos')
> ==>vp[name->foos]
> gremlin> v1.property(set, 'name', 'foo')
> ==>vp[name->foo]
> gremlin> v1.propert
> properties( property( 
> gremlin> v1.properties()
> ==>vp[name->foo]
> ==>vp[name->foo]
> ==>vp[name->foos]
> gremlin> v1.property('name', 'foo')
> ==>vp[name->foo]
> gremlin> v1.property(set, 'name', 'foo')
> ==>vp[name->foo]
> gremlin> v1.properties()
> ==>vp[name->foo]
> gremlin> v1 = g.addV("person").property(id, 1).property("name", 
> "marko").property("age", 29).next()
> Vertex with id already exists: 1
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> gremlin> gremlin> v2 = g.addV("software").property(id, 3).property("name", 
> "lop").property("lang", "java").next()
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> gremlin> gremlin> v2 = g.addV("software").property(id, 3).property("name", 
> "lop").property("lang", "java").next()
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> gremlin> gremlin> v2 = g.addV("software").property(id, 3).property("name", 
> "lop").property("lang", "java").next()
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> java.lang.NullPointerException
>  at 
> java.base/java.util.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1111)
>  at 
> java.base/java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1102)
>  at 
> org.codehaus.groovy.runtime.memoize.UnlimitedConcurrentCache.remove(UnlimitedConcurrentCache.java:70)
>  at 
> groovy.lang.GroovyClassLoader.removeClassCacheEntry(GroovyClassLoader.java:676)
>  at jdk.internal.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
>  at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>  at 
> org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
>  at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:211)
>  at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
>  at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
>  at 
> org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:98)
>  at org.codehaus.groovy.tools.shell.Evaluator$evaluate.call(Unknown Source)
>  at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:201)
>  at 
> org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
>  at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
>  at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
>  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
>  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
>  at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
>  at 
> org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:83)
>  at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:120)
>  at org.codehaus.groovy.tools.shell.Shell$leftShift$1.call(Unknown Source)
>  at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:93)
>  at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
>  at jdk.internal.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
>  at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
>  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
>  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
>  at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
>  at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:164)
>  at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:138)
>  at jdk.internal.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
>  at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>  at 
> org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
>  at 
> org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
>  at 
> org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
>  at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:160)
>  at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
>  at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
>  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:566)
>  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
>  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
>  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
>  at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
>  at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:164)
>  at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:97)
>  at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:234)
>  at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:168)
>  at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:234)
>  at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:502)
> gremlin>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to