gpt4 book ai didi

java - BaseDexClassLoader 中的 JSONSerializer.toJSON ClassNotFoundException

转载 作者:太空宇宙 更新时间:2023-11-04 07:06:54 24 4
gpt4 key购买 nike

我在使用 JSONSerializer 时遇到问题。我有这个方法:

public List<BusinessObject> transferToDomain(String pJSON) {
List<BusinessObject> lAllBusinessObject = new ArrayList<BusinessObject>();
if (null == pJSON || pJSON.equals("")) {
return lAllBusinessObject;
}
JSON lJSON = JSONSerializer.toJSON(pJSON);
if (lJSON.isEmpty()) {
return lAllBusinessObject;
} else {
if (lJSON.isArray()) {
JSONArray lJSONArray = (JSONArray) lJSON;
for (Object lObject : lJSONArray) {
JSONObject lJSONObject = (JSONObject) lObject;
lAllBusinessObject.add(doTransfer(lJSONObject));
}
} else {
JSONObject json = (JSONObject) lJSON;
BusinessObject lBusinessObject = doTransfer(json);
if (null != lBusinessObject) {
lAllBusinessObject.add(lBusinessObject);
}
}
}
return lAllBusinessObject;
}

它将 JSON 字符串转换为相关的业务对象。例如,使用该 Json-Code 行 JSONSerializer.toJSON(pJSon); 运行得很好:

[{"user":{"uid":51,"ustempel":0,"uname":"Stefan47"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":51,"rank":1,"sstempel":0,"model":"SCORE"},
{"user":{"uid":65,"ustempel":0,"uname":"Stefan61"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":65,"rank":2,"sstempel":0,"model":"SCORE"},
{"user":{"uid":66,"ustempel":0,"uname":"Stefan62"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":66,"rank":3,"sstempel":0,"model":"SCORE"},
{"user":{"uid":67,"ustempel":0,"uname":"Stefan63"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":67,"rank":4,"sstempel":0,"model":"SCORE"},
{"user":{"uid":68,"ustempel":0,"uname":"Stefan64"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":68,"rank":5,"sstempel":0,"model":"SCORE"},
{"user":{"uid":69,"ustempel":0,"uname":"Stefan65"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":69,"rank":6,"sstempel":0,"model":"SCORE"},
{"user":{"uid":70,"ustempel":0,"uname":"Stefan66"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":70,"rank":7,"sstempel":0,"model":"SCORE"},
{"user":{"uid":71,"ustempel":0,"uname":"Stefan67"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":71,"rank":8,"sstempel":0,"model":"SCORE"},
{"user":{"uid":72,"ustempel":0,"uname":"Stefan68"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":72,"rank":9,"sstempel":0,"model":"SCORE"},
{"user":{"uid":73,"ustempel":0,"uname":"Stefan69"
,"model":"USER"},"points":882,"level":27,"scomment":"Wuhuuuu"
,"sid":73,"rank":10,"sstempel":0,"model":"SCORE"}]

但使用 JSON 代码:

[{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":1,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"Die Bundesliga"
,"qid":1303,"qstempel":1390138057765,"model":"QUESTION"},
{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":1,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"Premiure League"
,"qid":1636,"qstempel":1390138059690,"model":"QUESTION"},
{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":3,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"WM"
,"qid":1582,"qstempel":1390138059395,"model":"QUESTION"},
{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":3,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"Die Bundesliga"
,"qid":1421,"qstempel":1390138058497,"model":"QUESTION"},
{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":3,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"Premiure League"
,"qid":1708,"qstempel":1390138060083,"model":"QUESTION"},
{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":1,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"WM"
,"qid":1470,"qstempel":1390138058774,"model":"QUESTION"},
{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":2,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"Premiure League"
,"qid":1667,"qstempel":1390138059857,"model":"QUESTION"},
{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":2,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"WM"
,"qid":1539,"qstempel":1390138059158,"model":"QUESTION"},
{"question":"Wer bist Du?"
,"answer1":"Jens"
,"answer2":"Anja"
,"answer3":"Stefan"
,"answer4":"Willi"
,"correctAnswer":3,"difficulty":2,"active":true,"deleted":false,"language":"DE"
,"key":"DE_QZ"
,"cat":"Die Bundesliga"
,"qid":1381,"qstempel":1390138058267,"model":"QUESTION"}]

抛出这个异常,我完全不知道为什么???

java.lang.ClassNotFoundException: Didn't find class "java.beans.PropertyDescriptor" on path: DexPathList[[zip file "/data/app/bc.qz.client.android-2.apk"],nativeLibraryDirectories=[/data/app-lib/bc.qz.client.android-2, /system/lib]]

谁能给我一些建议,为什么会发生这种情况?

提前致谢

斯特凡

最佳答案

java.lang.ClassNotFoundException: Didn't find class "java.beans.PropertyDescriptor" on path: DexPathList[[zip file "/data/app/bc.qz.client.android-2.apk"],nativeLibraryDirectories=[/data/app-lib/bc.qz.client.android-2, /system/lib]]

某些东西具有依赖关系,该依赖关系未加载到一个代码路径中,而是加载到另一个代码路径中。 Android API 仅提供 Java 6 API 的子集:

未提供

PropertyDescriptor。如果您自己的代码不使用此类型,那么您的库之一可能需要它。

关于java - BaseDexClassLoader 中的 JSONSerializer.toJSON ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21218197/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com