You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Daniel Kuppitz (JIRA)" <ji...@apache.org> on 2015/06/15 13:06:01 UTC

[jira] [Closed] (TINKERPOP3-727) use of repeat() with in() throws error

     [ https://issues.apache.org/jira/browse/TINKERPOP3-727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kuppitz closed TINKERPOP3-727.
-------------------------------------
    Resolution: Fixed

This is not a bug. {{in}} is a reserved keyword in Groovy, hence you have to add some verbosity, e.g.:

{code}
g.V(2).repeat(__.in()).times(1)
{code}

> use of repeat() with in() throws error
> --------------------------------------
>
>                 Key: TINKERPOP3-727
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-727
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: process
>            Reporter: Dylan Millikin
>             Fix For: 3.0.0.GA
>
>
> Using gremlin-server-M9.
> When doing {{repeat(in())}} we get an error (maybe there's confusion around the in() predicate).
> You can recreate like follows:
> {code:java}
>  bin/gremlin.sh
>          \,,,/
>          (o o)
> -----oOOo-(3)-oOOo-----
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> gremlin> :remote connect tinkerpop.server conf/remote.yaml
> ==>Connected - localhost/127.0.0.1:8182
> gremlin> :> TinkerFactory.generateClassic(graph)
> ==>null
> gremlin> :> g.V()
> ==>v[1]
> ==>v[2]
> ==>v[3]
> ==>v[4]
> ==>v[5]
> ==>v[6]
> gremlin> :> g.V(2).repeat(inE().outV()).times(1) 
> ==>v[1]
> gremlin> :> g.V(2).repeat(in()).times(1) 
> Script5.groovy: 1: unexpected token: in @ line 1, column 15.
>    g.V(2).repeat(in()).times(1)
>                  ^
> 1 error
> Display stack trace? [yN] y
> org.apache.tinkerpop.gremlin.groovy.plugin.RemoteException: startup failed:
> Script5.groovy: 1: unexpected token: in @ line 1, column 15.
>    g.V(2).repeat(in()).times(1)
>                  ^
> 1 error
> 	at org.apache.tinkerpop.gremlin.console.groovy.plugin.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:112)
> 	at org.apache.tinkerpop.gremlin.console.commands.SubmitCommand.execute(SubmitCommand.groovy:41)
> 	at org.codehaus.groovy.tools.shell.Shell.execute(Shell.groovy:101)
> 	at org.codehaus.groovy.tools.shell.Groovysh.super$2$execute(Groovysh.groovy)
> 	at sun.reflect.GeneratedMethodAccessor14.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.tools.shell.Groovysh.executeCommand(Groovysh.groovy:254)
> 	at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:153)
> 	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.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.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:134)
> 	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
> 	at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:292)
> {code}
> If it helps here is the error from the server :
> {noformat}
> [WARN] AbstractEvalOpProcessor - Exception processing a script on request [RequestMessage{, requestId=674798b0-8740-4c2b-bbe4-bdf1420ffd38, op='eval', processor='', args={gremlin=g.V(2).repeat(in()).times(1), batchSize=64}}].
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> Script5.groovy: 1: unexpected token: in @ line 1, column 15.
>    g.V(2).repeat(in()).times(1)
>                  ^
> 1 error
> 	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
> 	at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149)
> 	at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119)
> 	at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131)
> 	at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359)
> 	at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:142)
> 	at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108)
> 	at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236)
> 	at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:164)
> 	at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:928)
> 	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:590)
> 	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:566)
> 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:543)
> 	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:297)
> 	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:267)
> 	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:253)
> 	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:211)
> 	at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.getScriptClass(GremlinGroovyScriptEngine.java:368)
> 	at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:291)
> 	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
> 	at org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines.eval(ScriptEngines.java:89)
> 	at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$15(GremlinExecutor.java:187)
> 	at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor$$Lambda$97/122190960.call(Unknown Source)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)
> {noformat}



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