Inbound Scripted REST Request Fails With HTTP-500 Response and this in the Instance Node Log: java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@5265c1 Issue A web service client makes an inbound REST call using a scripted REST method. The client receives an HTTP-500 response code and the following similar message is seen in the node log: 2020-09-25 14:25:59 (976) API_INT-thread-3 7A32D42C1BEF5414102F11B61A4BCBE7 txid=be32d42c1bef WARNING *** WARNING *** Evaluator: java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@5265c1 Caused by error in sys_ws_operation.xxxxxxxxxxxxxxxxx.operation_script at line xcom.glide.util.JSONUtil.deserialize(JSONUtil.java:188)com.glide.util.JSONUtil.parseMap(JSONUtil.java:177)com.glide.util.JSONUtil.parseMap(JSONUtil.java:168)com.glide.util.JSONUtil.parse(JSONUtil.java:295)com.glide.rest.serializer.impl.JSONDeserializer.deserialize(JSONDeserializer.java:19)com.glide.rest.serializer.impl.RequestDeserializerImpl.parseRequest(RequestDeserializerImpl.java:168)com.glide.rest.serializer.impl.RequestDeserializerImpl.getRequestData(RequestDeserializerImpl.java:76)com.glide.rest.domain.ServiceRequestImpl.getRequestBodyAsObject(ServiceRequestImpl.java:96)com.glide.rest.service.custom.ScriptableServiceRequestBody.jsGet_data(ScriptableServiceRequestBody.java:110)sun.reflect.GeneratedMethodAccessor2248.invoke(Unknown Source)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)java.lang.reflect.Method.invoke(Method.java:498)org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)org.mozilla.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:305)org.mozilla.javascript.ScriptableObject.get(ScriptableObject.java:466)com.glide.script.fencing.ScopedScriptableObject.get(ScopedScriptableObject.java:64)com.glide.script.fencing.ScopedScriptableObject.get(ScopedScriptableObject.java:68)org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:2315)org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1533)org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1526)org.mozilla.javascript.gen.sys_ws_operation_eaecdac51bd35090102f11b61a4bcbb4_operation_script_78237._c_process_1(sys_ws_operation.eaecdac51bd35090102f11b61a4bcbb4.operation_script:4)org.mozilla.javascript.gen.sys_ws_operation_eaecdac51bd35090102f11b61a4bcbb4_operation_script_78237.call(sys_ws_operation.eaecdac51bd35090102f11b61a4bcbb4.operation_script)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2651)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2590)org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)org.mozilla.javascript.gen.sys_ws_operation_eaecdac51bd35090102f11b61a4bcbb4_operation_script_78237._c_script_0(sys_ws_operation.eaecdac51bd35090102f11b61a4bcbb4.operation_script:1)org.mozilla.javascript.gen.sys_ws_operation_eaecdac51bd35090102f11b61a4bcbb4_operation_script_78237.call(sys_ws_operation.eaecdac51bd35090102f11b61a4bcbb4.operation_script)org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:563)org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3429)org.mozilla.javascript.gen.sys_ws_operation_eaecdac51bd35090102f11b61a4bcbb4_operation_script_78237.call(sys_ws_operation.eaecdac51bd35090102f11b61a4bcbb4.operation_script)org.mozilla.javascript.gen.sys_ws_operation_eaecdac51bd35090102f11b61a4bcbb4_operation_script_78237.exec(sys_ws_operation.eaecdac51bd35090102f11b61a4bcbb4.operation_script)com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:279)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:118)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:82)com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:309)com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:214)com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:201)com.glide.rest.service.custom.CustomService.runScript(CustomService.java:96)com.glide.rest.service.custom.CustomService.execute(CustomService.java:83)com.glide.rest.handler.impl.ServiceHandlerImpl.invokeService(ServiceHandlerImpl.java:37)com.glide.rest.processors.RESTAPIProcessor.process(RESTAPIProcessor.java:290)com.glide.processors.AProcessor.runProcessor(AProcessor.java:553)com.glide.processors.AProcessor.processTransaction(AProcessor.java:240)com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:177)com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:166)com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:31)com.glide.sys.Transaction.run(Transaction.java:2192)java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)java.lang.Thread.run(Thread.java:748)ReleaseApplies to any release.CauseTo debug the issue further activate inbound REST debug by setting this system property: Name = glide.rest.debug Type = true|false Value = true Make the call again with this system property set and check the inbound JSON request body, for example this is logged in the node log: 2020-09-25 14:25:59 (975) API_INT-thread-3 7A32D42C1BEF5414102F11B61A4BCBE7 txid=be32d42c1bef DEBUG: #164573 [REST API] RequestDeserializer : Incoming Request Body:"[{\"number\":\"INC000000\",\"workflowID\":\"CHG000000\",\"Status\":\"Completed\",\"phase\":\"Issues with test\",\"modified_date\":\"14/09/2020 15:25:46\"}]" Put the JSON body into a JSON format validator, e.g.: https://jsonlint.com/ Putting in the above JSON will show that it is not valid: [{\"number\":\"INC000000\",\"workflowID\":\"CHG000000\",\"Status\":\"Completed\",\"phase\":\"Issues with test\",\"modified_date\":\"14/09/2020 15:25:46\"}] This is why the call is failing, the JSON request body is not formatted as valid JSON.ResolutionThe web service client must send a valid JSON request body to the instance. Once this is done the HTTP-500 and the message: Evaluator: java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@5265c1 Should no longer occur. For the example given this would be a valid JSON request body: {"number":"INC000000","workflowID":"CHG000000","Status":"Completed","phase":"Issues with test","modified_date":"14/09/2020 15:25:46"} This again can be verified at a JSON validator, e.g.: https://jsonlint.com/