Comments (10)
Within a scala play app I had:
val req = Cypher("start n=node(*) return n.name")
which would return ca. 10.000 nodes, calling
val stream = req()
caused:
play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[RuntimeException: error:dispatch.StatusCode: Unexpected response status: 400]]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.4]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.4]
at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2]
at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.4]
at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2]
Caused by: java.lang.RuntimeException: error:dispatch.StatusCode: Unexpected response status: 400
at org.anormcypher.Neo4jREST$.sendQuery(Neo4jREST.scala:26) ~[classes/:na]
at org.anormcypher.CypherStatement.apply(AnormCypher.scala:313) ~[classes/:na]
at controllers.Application$$anonfun$index$1.apply(Application.scala:19) ~[classes/:na]
at controllers.Application$$anonfun$index$1.apply(Application.scala:9) ~[classes/:na]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1.jar:2.0.4]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1.jar:2.0.4]
Just getting a single node worked like a charm.
from anormcypher.
Thanks Stephan, I'm planning to revamp the error handling so you can actually see what the response from the service is, instead of just 400. Can you run your query with curl? I think the server is actually choking on it.
On Dec 19, 2012, at 4:30 AM, Stephan Froede [email protected] wrote:
Within a scala play app I had:
val req = Cypher("start n=node(*) return n.name")
which would return ca. 10.000 nodes, calling
val stream = req()
caused:
play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[RuntimeException: error:dispatch.StatusCode: Unexpected response status: 400]]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.4]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.4]
at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2]
at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.4]
at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2]
Caused by: java.lang.RuntimeException: error:dispatch.StatusCode: Unexpected response status: 400
at org.anormcypher.Neo4jREST$.sendQuery(Neo4jREST.scala:26) ~[classes/:na]
at org.anormcypher.CypherStatement.apply(AnormCypher.scala:313) ~[classes/:na]
at controllers.Application$$anonfun$index$1.apply(Application.scala:19) ~[classes/:na]
at controllers.Application$$anonfun$index$1.apply(Application.scala:9) ~[classes/:na]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1.jar:2.0.4]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1.jar:2.0.4]Just getting a single node worked like a charm.
—
Reply to this email directly or view it on GitHub.
from anormcypher.
Hi Wes,
curl?I have no clue how to use cypher queries from curl.
However, the cypher query is working from the data browser and a more complex version of it:
start f=node:user_profiles(name="Group")
match f-[user_weight:car_item]->car_item-[car_weight:describes_car]->car
where
(
(car_item.mappingtype="Absolut" and user_weight.weight=car_weight.weight)
OR
(car_item.mappingtype="Norm" and abs(user_weight.weight-car_weight.weight)<=1)
)
with car, count(car_item) as matches, sum(abs(user_weight.weight-car_weight.weight)) as delta
where matches>3 and delta>0 and delta<3
with car, matches, delta
order by delta, car.preis_eur asc
limit 55
return car.name, car.preis_eur, delta, matches
// response <500 ms in average
I filled Neo4J with the batch-importer
I also ran into problems trying to use ExecutionEngine with Java, I have some doubts regarding the REST API it behaves not as expected with cypher queries.
I will try an embedded approach.
Regards,
Stephan
from anormcypher.
Are you using 1.9?
from anormcypher.
Yep.
Is that causing this problems!?
from anormcypher.
No, but your query wouldn't even run in 1.8.x--which could have been causing the 400 error (that's why I asked). I think it's actually a timeout issue when the data is pretty big. There was some discussion on the google group about a similar error with the PHP REST driver.
from anormcypher.
Hmm, the data from the request are not so big just 55 rows with 4 columns, my impression was that the query itself is causing the problem not the data delivered.
As I tried REST with Java, I had heap space problems (with 220 cells), the problem occured somewhere in REST Api, it looked like a loop that went out of control (it crashed always with an array operation).
Since AnormCypher is more or less using the same underlying REST Apis, I think it could be the same problem (that is only guessing by intuition).
from anormcypher.
I need to make the 400 error give the body of the response through AnormCypher's exception, because it will usually tell you exactly where it doesn't like your query. I have an open issue for that (when I was using it myself recently, that was my main pain point)--I'll try to fix it this weekend.
from anormcypher.
To test your query in CURL you can just run (replace your query--you might want to use single quotes instead of double, to avoid needing to escape them:
curl -X POST -H Accept:application/json -H Content-Type:application/json -v http://localhost:7474/db/data/cypher -d '{"query":"start n=node(*) return n;", "params":{}}'
from anormcypher.
The Curl statement worked, it needed under 1 sec to print all 9378 nodes in the terminal.
It would surly help a lot if AnormCypher would give more details, I tried it myself but I was not able to get more informations.
I am using Neo4J as an embedded db (in play!) at the moment (as I was not able to connect via REST), but it looks very pragmatic resp. ugly, using REST would probably allow for a much more scalable and flexible architecture - and more elegant as well.
from anormcypher.
Related Issues (20)
- Add Play 2.5 support HOT 2
- NoSuchMethodError with Play 2.5 HOT 21
- With Neo4j 3.0.x, Cypher query returning 2 results per record (one with actual value, one with null) HOT 7
- Generating Dynamic CQL in AnormCypher HOT 2
- Parse meta data returned from neo4j 3.0 tx endpoint
- Use macro to ensure that all code within the withTx block is executed sequentially HOT 1
- A number of the tests are failing with an exception HOT 5
- AnormCypher fails resolving dependencies HOT 5
- Neo4jREST.mapFormat doesn't support JsNull values HOT 5
- neo4j-jdbc HOT 3
- Async transaction support
- Cannot query data with neo4j 3.2.1 HOT 1
- initialCommands in console
- Query performance regressions since v0.7.1 HOT 2
- repo.anormcypher.org down HOT 3
- Clustering
- Release version for 2.12 HOT 1
- NingWSClient requires akka.stream.Materializer, and is deprecated
- Mirror packages on Maven Central HOT 1
- [email protected]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anormcypher.