ArrayIndexOutOfBoundsException at org.boon.json.implementation.Json

Hey guys,

we have some parsing issues with some of our requests. It looks like the boon parser does not like whitespaces :slight_smile: Should I file an issue?

Gatling 2.0.0-SNAPSHOT
boon:0.22

Request:

GET http://192.168.33.62:8009/monitoring/jolokia/read/com.openexchange.pooling:name=ConfigDB%20Read/MaxUseTime

Response:

{
“timestamp”:1405673028,
“status”:200,
“request”:{
“mbean”:“com.openexchange.pooling:name=ConfigDB Read”,
“attribute”:“MaxUseTime”,
“type”:“read”
},
“value”:24
}

stacktrace:

10:08:38.044 [INFO ] i.g.h.a.HttpRequestAction$ - Sending request=JolokiaRequest uri=http://192.168.33.62:8009/monitoring/jolokia/read/com.openexchange.pooling:name=ConfigDB Read/MaxUseTime: scenario=QAPerfJolokia, userId=5912326778645399453-0
10:08:38.052 [INFO ] i.g.h.c.b.HttpBodyJsonPathCheckBuilder$ - Could not parse response into a JSON object: -1
java.lang.ArrayIndexOutOfBoundsException: -1
at org.boon.json.implementation.JsonParserCharArray.skipWhiteSpaceIfNeeded(JsonParserCharArray.java:98) ~[boon-0.22.jar:na]
at org.boon.json.implementation.JsonFastParser.decodeValueOverlay(JsonFastParser.java:138) ~[boon-0.22.jar:na]
at org.boon.json.implementation.JsonFastParser.parse(JsonFastParser.java:330) ~[boon-0.22.jar:na]
at org.boon.json.implementation.BaseJsonParser.parse(BaseJsonParser.java:127) ~[boon-0.22.jar:na]
at io.gatling.core.json.Boon$.parse(Boon.scala:33) ~[gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.check.body.HttpBodyJsonPathCheckBuilder$$anonfun$1.apply(HttpBodyJsonPathCheckBuilder.scala:54) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.check.body.HttpBodyJsonPathCheckBuilder$$anonfun$1.apply(HttpBodyJsonPathCheckBuilder.scala:52) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.check.body.HttpBodyJsonPathCheckBuilder$$anonfun$handleParseException$1.apply(HttpBodyJsonPathCheckBuilder.scala:41) [gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.check.body.HttpBodyJsonPathCheckBuilder$$anonfun$handleParseException$1.apply(HttpBodyJsonPathCheckBuilder.scala:39) [gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.CheckBase$$anonfun$io$gatling$core$check$CheckBase$$memoizedPrepared$1$1.apply(Check.scala:76) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.CheckBase$$anonfun$io$gatling$core$check$CheckBase$$memoizedPrepared$1$1.apply(Check.scala:76) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:189) [scala-library-2.10.4.jar:na]
at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91) [scala-library-2.10.4.jar:na]
at io.gatling.core.check.CheckBase.io$gatling$core$check$CheckBase$$memoizedPrepared$1(Check.scala:76) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.CheckBase$$anonfun$check$2$$anonfun$apply$2.apply(Check.scala:82) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.CheckBase$$anonfun$check$2$$anonfun$apply$2.apply(Check.scala:81) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.validation.Success.flatMap(Validation.scala:33) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.CheckBase$$anonfun$check$2.apply(Check.scala:81) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.CheckBase$$anonfun$check$2.apply(Check.scala:80) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.validation.Success.flatMap(Validation.scala:33) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.CheckBase.check(Check.scala:80) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.check.HttpCheck.check(HttpCheck.scala:35) [gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.check.HttpCheck.check(HttpCheck.scala:32) [gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.Check$.checkRec$1(Check.scala:37) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.check.Check$.check(Check.scala:58) [gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.ahc.AsyncHandlerActor.checkAndProceed$1(AsyncHandlerActor.scala:259) [gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.ahc.AsyncHandlerActor.io$gatling$http$ahc$AsyncHandlerActor$$processResponse(AsyncHandlerActor.scala:288) [gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.ahc.AsyncHandlerActor$$anonfun$receive$1.applyOrElse(AsyncHandlerActor.scala:85) [gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498) [akka-actor_2.10-2.2.4.jar:2.2.4]
at akka.actor.ActorCell.invoke(ActorCell.scala:456) [akka-actor_2.10-2.2.4.jar:2.2.4]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237) [akka-actor_2.10-2.2.4.jar:2.2.4]
at akka.dispatch.Mailbox.run(Mailbox.scala:219) [akka-actor_2.10-2.2.4.jar:2.2.4]
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:385) [akka-actor_2.10-2.2.4.jar:2.2.4]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.10.4.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.10.4.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.10.4.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.10.4.jar:na]

I just did: https://github.com/RichardHightower/boon/issues/202
Thanks for reporting. I hope Rick will be able to fix this pretty soon.

I’ll also add an option so you can fall back to Jackson: https://github.com/excilys/gatling/issues/2015

Actually, neither Rick nor I are able to reproduce.
Could you share a reproducer, or at least dump the response body into a file and send it to me, please?

Note that I was maybe too fast on declaring the problem was on Boon side.
It could also be on yours, and your JSON response sometimes be broken.

Hi,

sorry but the problem is on our side :frowning: just double checked the request myself and I found out that the GET request was not correct encoded.

Request:

GET /monitoring/jolokia/read/com.openexchange.pooling:name=ConfigDB Read/MaxUseTime HTTP/1.1…Host: 192.168.32.185:8009…Connection: keep-alive…Accept: text/html,application/xhtml+xml,application/x-w

Response:

HTTP/1.1 505 HTTP Version Not Supported…Date: Fri, 18 Jul 2014 21:28:16 GMT…Connection: close…Content-Length: 0…

There is a whitespace in the request which is not rfc conform. I’ll fix it on our side by using the URLEncoder from java.

Once again sorry for the noise.

No problem, and glad you found it out.