Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javax.script.ScriptException with Object argument #63

Open
gregory-h opened this issue Jan 6, 2016 · 2 comments
Open

javax.script.ScriptException with Object argument #63

gregory-h opened this issue Jan 6, 2016 · 2 comments

Comments

@gregory-h
Copy link

Apologies if I'm misunderstanding the api but to query a Vertex on multiple properties I do

var query = gremlin()
query(g.V({type:'Task',name:'Setup'}))
client.execute( query .. )

or even with just one property

query(g.V({type:'Task'}))
client.execute( query, function(err,response) {

This returns an exception,

execution returned err,result [Error: javax.script.ScriptException: groovy.lang
MissingMethodException: No signature of method: groovy.lang.MissingMethodExcept
on.V() is applicable for argument types: (java.util.LinkedHashMap) values: [[@t
pe:ita:Task]]
Possible solutions: _(groovy.lang.Closure), is(java.lang.Object), any(), use([L
ava.lang.Object;), any(groovy.lang.Closure), wait()] undefined

I'm completely new to this technology stack, any suggestions how to diagnose?

@jbmusso
Copy link
Owner

jbmusso commented Jan 11, 2016

Can you please try the following;

console.log(query.script);
console.log(query.params);`

And post the returned results? Debugging the raw query object populated is a useful trick to see if the sent Gremlin Groovy query is valid or not.
If you're using ES6/2015 JavaScript, I recommend you check gremlin-template-string which will help you generate Gremlin queries.

Also, you may want to consider switching to TinkerPop3 (see https://github.com/jbmusso/gremlin-javascript). gRex, that works with TinkerPop 2.x, will be soon deprecated.

@gregory-h
Copy link
Author

Thx for the reply.

here's my query

var query = gremlin()
query(g.V({'@type':'ita:Task',name:'Setup'}))
console.log('script is ', query.script)
console.log('params are ', query.params)
client.execute(query, function..)

running this produces

script is g.V(["@type":"ita:Task","name":"Setup"])
params are {}
query by multiple attributes returned err,result [Error: javax.script.ScriptEx
ption: groovy.lang.MissingMethodException: No signature of method: groovy.lang
issingMethodException.V() is applicable for argument types: (java.util.LinkedH
hMap) values: [[@type:ita:Task, name:Setup]]
Possible solutions: _(groovy.lang.Closure), is(java.lang.Object), any(), use([
ava.lang.Object;), any(groovy.lang.Closure), wait()] undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants