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

Passing array argument results in java class cast exception #54

Open
gching opened this issue Dec 2, 2014 · 0 comments
Open

Passing array argument results in java class cast exception #54

gching opened this issue Dec 2, 2014 · 0 comments

Comments

@gching
Copy link

gching commented Dec 2, 2014

I am probably doing something wrong here but just wanted to post it here if it is an actual error.

I am passing an array of strings over to be used as an argument for the .out() transform function. Specifically, my code is the following:

var point_of_traverse_vertice = query.var(g.V('name', point_of_traverse_id).next())
query(point_of_traverse_vertice.out(['edge_label_1', 'edge_label_2']))

This will result in an error with the following stacktrace:

 Error: javax.script.ScriptException: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List
      at RexsterClient.<anonymous> (/Users/gching/Projects/app-builder/api/node_modules/grex/src/rexsterclient.js:117:34)
      at IncomingMessage.EventEmitter.emit (events.js:117:20)
      at _stream_readable.js:910:16
      at process._tickCallback (node.js:415:13)

Trying to debug it personally, the script being sent over is:

/graphs/graph/tp/gremlin?script=i0%3Dg.V('name'%2C'id').next()%0Ag.V('name'%id').next().out(%5B'edge_label_1'%2C'edge_label_2'%5D)%0A&rexster.showTypes=true&

The thing to note is that %5B and %5D is present, which represents the [ and ] respectively. I am assuming that is being parsed through ArrayArgument rather than the Argument helper class. I don't know much about the code base and have just recently started using grex so I might be making wrong assumptions; do tell me if I am.

Thanks for the help!

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

1 participant