-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[QUESTION] NoClassDefFoundError: Failed resolution of: Ljava/awt/Color #511
Comments
2.0.8.android的兼容包确实有这个问题,你可以先用2.0.9.android-SNAPSHOT先验证下么? |
@wenshao 遇到了另一个问题,关于非静态内部类的 case,现象就是非静态内部类反序列化的时候会报一个异常:
debug 后发现在 fastJson2 中 ObjectReaderCreator 的 createInstanceSupplier 方法: public <T> Supplier<T> createInstanceSupplier(Class<T> objectClass) {
// ......
final Constructor<T> constructor;
try {
constructor = objectClass.getDeclaredConstructor();
constructor.setAccessible(true);
} catch (NoSuchMethodException ignored) {
return null;
} catch (Throwable e) {
throw new JSONException("get constructor error, class " + objectClass.getName(), e);
}
// ......
} 当 objectClass 是非静态内部类的时候,这里会抛出 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
版本: com.alibaba:fastjson:2.0.8.android
在 android 上集成以上版本,使用
JSON.parse
相关方法后会直接崩溃,报错信息:java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Color; at com.alibaba.fastjson2.support.AwtRederModule.getObjectReader(AwtRederModule.java:27) at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReader(ObjectReaderProvider.java:658) at com.alibaba.fastjson2.JSONReader.read(JSONReader.java:1426) at com.alibaba.fastjson2.JSONReader.readAny(JSONReader.java:1613) at com.alibaba.fastjson.JSON.parse(JSON.java:408)
The text was updated successfully, but these errors were encountered: