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

stephen mallette commented on TINKERPOP-2084:
---------------------------------------------

After the fix, the failure from the description now displays as:

{code}
gremlin> g.V().outE().out()
org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge cannot be cast to 
org.apache.tinkerpop.gremlin.structure.Vertex
Type ':help' or ':h' for help.
Display stack trace? [yN]y
java.lang.ClassCastException: 
org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge cannot be cast to 
org.apache.tinkerpop.gremlin.structure.Vertex
        at 
org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep.flatMap(VertexStep.java:54)
        at 
org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:49)
        at 
org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
        at 
org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)
        at 
org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor.handleIterator(AbstractOpProcessor.java:101)
        at 
org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.lambda$evalOpInternal$5(AbstractEvalOpProcessor.java:278)
        at 
org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:274)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
{code}

> For remote requests in console display the remote stack trace
> -------------------------------------------------------------
>
>                 Key: TINKERPOP-2084
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2084
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: console
>    Affects Versions: 3.3.4
>            Reporter: stephen mallette
>            Assignee: stephen mallette
>            Priority: Minor
>
> When sending remote scripts through the Gremlin Console that return an error, 
> the console will display the message from the server, but if you view the 
> stack trace it displays the local one which isn't helpful in understanding 
> the cause of the failure. Here's an example:
> {code}
> gremlin> g.V().outE().out()
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge cannot be cast 
> to org.apache.tinkerpop.gremlin.structure.Vertex
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: 
> org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge cannot be cast 
> to org.apache.tinkerpop.gremlin.structure.Vertex
>       at 
> org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:180)
>       at 
> org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
>       at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
>       at 
> org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
>       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:498)
>       at 
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
>       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
>       at 
> org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
>       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:498)
>       at 
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
>       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
>       at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
>       at 
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
>       at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
>       at 
> org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:148)
>       at 
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
>       at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:455)
> {code}
> This forces the user to then dig around server logs to try to determine the 
> more accurate cause of the error to their script. That's not always easy, 
> especially if the console is connected to a Remote Gremlin Provider and 
> server access is not possible. This change should only be for actual 
> {{ResponseException}} that actually have a stacktrace included, otherwise it 
> should just use the local one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to