2014-01-30 3 views
1

JSP로 작성된 웹 응용 프로그램에 새로운 기능을 추가하고 유지하기 위해 jine-RPC, jQuery 및 Java 2000 라인 자바 스크립트 파일 inorder를 편집 할 수없는 작업이 있습니다. . 기본 javascript 지식을 제외하고 jQuery 및 Json-RPC에 대한 더 자세한 지식은 갖고 있지 않으며 원래 개발자는 더 이상 존재하지 않습니다. 이 몇 PARAMS을 허용하는 JS 기능이며, JSON-RPC를 호출하고 여기에 나는 비 정렬 화되지JSON-RPC 호출 중에 "arg 1 unmarshal"할 수 없습니다

누군가가 무엇을이 오류 말해 주실 수있는 오류

인수 1을 얻고있다 방법?

여기에 내 코드

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 could not unmarshal를 얻을. 어떤 힌트를 주셔서 감사합니다

답변

0

OK, 해결 됐어요. 원격 함수의 첫 번째 매개 변수는 Map<String, SomeBO>의 목록을 기대합니다. SomeBO은 여러 개의 BigDecimal이있는 빈입니다. Map에 전달 된 값을 설정 한 다른 JS 함수가 있습니다. 이 함수는 String의 설정자를 가진 BigNumber을 설정합니다. JSON unmarshaller에서 가져온 오류가 좀 더 설명 적이기를 바란다. 아래 코드는 문제를 해결하기 위해 을 추가 한 코드이다.

foreignReportMap[pReportId].map["row_" + pRowId].clientQuantity =  clientQuantity.toString(); 
foreignReportMap[pReportId].map["row_" + pRowId].totalClientQuantity = totalClientQuantity.toString(); 
관련 문제