ArrayIndexOutOfBoundsException

Hi Stephane,

I am getting ArrayIndexOutOfBoundsException intermittently while running my script for load test. Below is my code and it is failing at request 27

.check(jsonPath("$.controllerData.MashupRefs.MashupRef[0].Output.Shipment.NewShipment.TotalNumberOfRecords").saveAs(“TotalNumberOfRecords”)))
.pause(11)
.exec(session => {session.set (“fos”,43)})
.repeat("${fos}" )
{

exec(http(“request_22”)
.get("/isf/store/assets/store-frontend/i18n/shipment-pick/en.json")
.headers(headers_1)
.resources(http(“request_23”)
.get("/isf/store/assets/store-frontend/i18n/backroom-pick/en.json")
.headers(headers_1),
http(“request_24”)
.get("/isf/store/assets/store-frontend/i18n/shared/en.json")
.headers(headers_1),
http(“request_25”)
.get("/isf/store/assets/store-frontend/i18n/app-common/en.json")
.headers(headers_1),
http(“request_26”)
.post("/isf/store/mashupController.do")
.headers(headers_26)
.formParam(“scControllerData”, “”"{“MashupRefs”:{“MashupRef”:[{“mashupId”:“isf.shipment-pick.pick-order-list.getPickOrderListForBOPIS”,“Input”:{“Shipment”:{“ComplexQuery”:{“And”:{“Or”:[{“Exp”:[{“Name”:“Status”,“QryType”:“EQ”,“Value”:“1100.70.06.10”}]},{“Exp”:[{“Name”:“DocumentType”,“QryType”:“FLIKE”,“Value”:“0001”},{“Name”:“DocumentType”,“QryType”:“FLIKE”,“Value”:“0006”}]}]}}}}},{“mashupId”:“isf.shipment-pick.pick-order-list.getPickOrderListForSFS”,“Input”:{“Shipment”:{“ComplexQuery”:{“And”:{“Or”:[{“Exp”:[{“Name”:“Status”,“QryType”:“EQ”,“Value”:“1100.70.06.10”}]},{“Exp”:[{“Name”:“DocumentType”,“QryType”:“FLIKE”,“Value”:“0001”},{“Name”:“DocumentType”,“QryType”:“FLIKE”,“Value”:“0006”}]}]}}}}}],“isMultiAPICall”:false}}""")
.formParam(“scCSRFToken”, “${scCSRFToken}”)
.formParam(“scFlag”, “Y”)))

.exec(http(“request_27”)
.post("/isf/store/mashupController.do")
.headers(headers_27)
.formParam(“scControllerData”, “”"{“MashupRefs”:{“MashupRef”:[{“mashupId”:“extn.isf.shipment-pick.pick-order-list.getSFSPickOrderList”,“Input”:{“Shipment”:{“ComplexQuery”:{“And”:{“Or”:[{“Exp”:[{“Name”:“Status”,“QryType”:“EQ”,“Value”:“1100.70.06.10”}]},{“Exp”:[{“Name”:“DocumentType”,“QryType”:“FLIKE”,“Value”:“0001”},{“Name”:“DocumentType”,“QryType”:“FLIKE”,“Value”:“0006”}]}]}},“DeliveryMethod”:“PICK”,“OrderBy”:{“Attribute”:{“Desc”:“N”}}}},“isPaginated”:“true”,“scPageSize”:“10”,“scPageNumber”:“1”,“scPaginationStrategy”:“NEXTPAGE”}],“isMultiAPICall”:false}}""")
.formParam(“scCSRFToken”, “${scCSRFToken}”)
.formParam(“scFlag”, “Y”)
.transformResponse { (session, response) =>
if (response.status.code == 200) {
response.copy(body = new StringResponseBody(response.body.string.replaceAll("\\", “”), response.charset))
//response.copy(body = new StringResponseBody(response.body.string.replaceAll("\'s",""), response.charset))
} else {
response
}
}

// .check(bodyString.saveAs(“Picklistresponse”))
.check(jsonPath("$.controllerData.MashupRefs.MashupRef[0].Output.Page.Output.Shipments.Shipment[0].ShipmentKey").find.saveAs(“ShipmentKey”))
.check(jsonPath("$.controllerData.MashupRefs.MashupRef[0].Output.Page.Output.Shipments.Shipment[0].ShipmentLines.ShipmentLine[0].OrderLine.ItemDetails.ItemID").find.saveAs(“ItemID”))
.check(jsonPath("$.controllerData.MashupRefs.MashupRef[0].Output.Page.Output.Shipments.Shipment[0].ShipmentLines.ShipmentLine[0].ShipmentLineKey").find.saveAs(“ShipmentLineKey”))
.check(jsonPath("$.controllerData.MashupRefs.MashupRef[0].Output.Page.Output.Shipments.Shipment[0].ShipmentLines.ShipmentLine[0].Quantity").find.saveAs(“Quantity”))
.check(jsonPath("$.controllerData.MashupRefs.MashupRef[0].Output.Page.Output.Shipments.Shipment[0].ShipmentLines.ShipmentLine[0].OrderHeaderKey").find.saveAs(“OrderHeaderKey”))
.check(jsonPath("$.controllerData.MashupRefs.MashupRef[0].Output.Page.Output.Shipments.Shipment[0].ShipmentLines.ShipmentLine[0].OrderLineKey").find.saveAs(“OrderLineKey”)))

EXCEPTION :

Jodd failed to parse into a valid AST: j.l.ArrayIndexOutOfBoundsException: 32902 java.lang.ArrayIndexOutOfBoundsException: 32902 at jodd.json.JsonParser.parseObjectContent(JsonParser.java:1120) at jodd.json.ObjectParser.get(ObjectParser.java:72) at jodd.json.JsonParser.resolveLazyValue(JsonParser.java:593) at jodd.json.JsonParser._parse(JsonParser.java:429) at jodd.json.JsonParser.parse(JsonParser.java:382) at io.gatling.core.json.JoddJson.parse(JoddJson.scala:27) at io.gatling.core.json.JsonParsers.$anonfun$safeParseJodd$1(JsonParsers.scala:45) at io.gatling.commons.validation.package$.safely(package.scala:34) at io.gatling.core.json.JsonParsers.safeParseJodd(JsonParsers.scala:45) at io.gatling.core.json.JsonParsers.safeParse(JsonParsers.scala:51) at io.gatling.http.check.body.HttpBodyJsonPathCheckMaterializer$.$anonfun$jsonPathPreparer$1(HttpBodyJsonPathCheckMaterializer.scala:48) at io.gatling.core.check.CheckBase.memoizedPrepared$1(Check.scala:74) at io.gatling.core.check.CheckBase.$anonfun$check$6(Check.scala:88) at io.gatling.commons.validation.Success.flatMap(Validation.scala:43) at io.gatling.core.check.CheckBase.$anonfun$check$4(Check.scala:87) at io.gatling.commons.validation.Success.flatMap(Validation.scala:43) at io.gatling.core.check.CheckBase.check(Check.scala:86) at io.gatling.http.check.HttpCheck.check(HttpCheck.scala:36) at io.gatling.http.check.HttpCheck.check(HttpCheck.scala:33) at io.gatling.core.check.Check$.checkRec$1(Check.scala:38) at io.gatling.core.check.Check$.check(Check.scala:48) at io.gatling.http.engine.response.CheckProcessor$.check(CheckProcessor.scala:45) at io.gatling.http.engine.response.SessionProcessor.updatedSession(SessionProcessor.scala:67) at io.gatling.http.engine.response.DefaultResponseProcessor.handleResponse0(ResponseProcessor.scala:134) at io.gatling.http.engine.response.DefaultResponseProcessor.handleResponse(ResponseProcessor.scala:74) at io.gatling.http.engine.response.DefaultResponseProcessor.onComplete(ResponseProcessor.scala:56) at io.gatling.http.engine.GatlingHttpListener.onHttpResponseBodyChunk(GatlingHttpListener.scala:91) at io.gatling.http.client.impl.HttpAppHandler.channelRead(HttpAppHandler.java:195) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1436) at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1203) at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1247) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:745)

Please let me know how to resolve it.

Thanks,
Trisha Agarwal

First thing I see is you’re using an old version of Gatling.
Please upgrade to 3.6.1 and report again if you still experience an issue.