Java &引用;arg 1无法解组";在JSON-RPC调用期间
我的任务是编辑一个2000行的javascript文件,以维护并向用JSP、Json RPC、jQuery和Java编写的web应用程序添加一些新功能。除了基本的Javascript知识外,我对jQuery和Json RPC没有任何更深层次的了解,而原来的开发人员已经不在那里了。 有一个JS函数,它接受一些参数,并调用Json RPC,这里我得到了错误 arg 1无法解组 有人能告诉我这个错误是什么意思吗 这是我的密码Java &引用;arg 1无法解组";在JSON-RPC调用期间,java,javascript,json,json-rpc,Java,Javascript,Json,Json Rpc,我的任务是编辑一个2000行的javascript文件,以维护并向用JSP、Json RPC、jQuery和Java编写的web应用程序添加一些新功能。除了基本的Javascript知识外,我对jQuery和Json RPC没有任何更深层次的了解,而原来的开发人员已经不在那里了。 有一个JS函数,它接受一些参数,并调用Json RPC,这里我得到了错误 arg 1无法解组 有人能告诉我这个错误是什么意思吗 这是我的密码 function distributeQuantityNew(pReport
function distributeQuantityNew(pReportId, pDecimalPlaces, pRun) {
try {
alert('distributeQuantityNew: ' + pReportId + ', ' + pDecimalPlaces + ', ' + pRun);
var fieldValue = $("#distribution_quantity_" + pReportId).val();
if (fieldValue.length == 0) {
showErrorDialog(resourceBundleMap["error.no.distribution.quantity"]);
return;
} else {
$("#distribution_quantity_" + pReportId).val("");
}
var affectedRowIds = [];
var rows = $("#tableBody_" + pReportId + " tr:visible").has("input[type=text]").filter(function(index) {
var voucherType = this.cells[getVoucherColumnIndex()].innerHTML;
if ((voucherType == 'TRANSFER_CS') || (voucherType == 'PAYOUT_CS') || (voucherType == 'SOURCE_BON') || (voucherType == 'PAYOUT_BON')) {
return false;
}
affectedRowIds.push(parseInt(this.id.split("_")[3]));
return true;
}
);
var affectedReportRows = $.extend(true, {}, foreignReportMap[pReportId]);
$.each(affectedReportRows.map, function(i, row) {
if ($.inArray(row.partnerReportBillNr, affectedRowIds) == -1) {
delete affectedReportRows.map["row_" + row.partnerReportBillNr];
}
});
var report = getLoadedReportByRunId(pReportId);
var productType = report.partnerProductType;
SessionManager.extend();
var resultRows = jsonrpc.foreignReportObject.distributeQuantity(affectedReportRows, fieldValue, pDecimalPlaces, pRun);
alert('back after RPC');
$.each(resultRows.map, function(i, row) {
foreignReportMap[pReportId].map["row_" + row.partnerReportBillNr] = row;
updateForeignReportRow(row, true, productType);
});
updateSummaryRow(pReportId);
toggleApproveAllLink(pReportId);
sortForeignReportTable(pReportId, true);
} catch (e) {
handleError("Failed to distribute quantity: ", e);
}
}
我给它添加了警报,以便知道RPC调用是否成功,但在此之前,我从catch块得到了错误
arg 1无法解组。谢谢你的提示好的,问题解决了。远程功能的第一个参数需要一个Map
列表SomeBO
是一个具有多个大小数的bean。我有另一个JS函数,它设置了传递到映射中的值。这个函数设置了一个BigNumber
,其中我只有一个String
的setter。我希望从JSON解组器返回的错误更具描述性……下面是我添加.toString()
以解决问题的代码
foreignReportMap[pReportId].map["row_" + pRowId].clientQuantity = clientQuantity.toString();
foreignReportMap[pReportId].map["row_" + pRowId].totalClientQuantity = totalClientQuantity.toString();