遇到一個很奇怪的問題。。有大神來幫忙嗎?,很奇怪大神

來源:互聯網
上載者:User

遇到一個很奇怪的問題。。有大神來幫忙嗎?,很奇怪大神

 

在402行會拋出異常

InvocationTargetException

查了一下關於這個異常的解決辦法。。但是都沒什麼實際的效果,。有大神知道嗎?一個很接單的問題。。雖然最終我用GSON一樣繞過去了。。但是心裡還是感覺怪怪的。。

 //1.通過icid尋找客戶秘鑰
String key=Jsoup.connect(NMApi.url() + "/Stores/findKey")
.timeout(60000)
.data("icid", icid)
.post()
.text();
if(key==""||key==null){
return "查詢客戶秘鑰失敗";
}
String result = Jsoup.connect(NMApi.url() + "/wh/goods").timeout(10000)
.data("RequestName", "wGoodsInfo")
.data("icID", icid)
.data("cKey", key)
.data("cDepot", cdepot)
.data("iPage", "1")
.data("iPagePer", "111")
.data("cqgCode", "")
.data("cqcCode", "")
.data("iqwGiid", "")
.data("nqType", "0")
.get()
.text();
System.out.println("查詢物品的字串"+result);
Map<String,Object> map = new Gson().fromJson(result,new TypeToken<Map<String,Object>>() {}.getType());
System.out.println("查詢物品的MAP"+map);

ArrayList<goodsRec> reclist = new ArrayList<>();
reclist =(ArrayList<goodsRec>) map.get("RecList");
// String re = new Gson().toJson(reclist);
// reclist = new Gson().fromJson(re,new TypeToken<ArrayList<goodsRec>>() {}.getType());
// //對查詢物品的集合進行遍曆。比較其中的物品名稱和SKU、如有相同提取該物品的iwGiid.
String giid="";
goodsRec aa =reclist.get(4);
String na =reclist.get(4).getIwGiid();
for(int i=0;i<reclist.size();i++){
if(reclist.get(i).getCgName().equals(cgoods)||reclist.get(i).getCgCode().equals(cgoods)){
// String na =reclist.get(4).get("iwGiid");
giid =reclist.get(i).getIwGiid();
System.out.println(giid);
}
}
if(giid==""){
return "查無此物品";
}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.