使用使用 java.beans 类的 jar(Introspector、BeanInfo 或 PropertyDescriptor) [英] Using jars that use java.beans classes (Introspector, BeanInfo or PropertyDescriptor)

查看:10
本文介绍了使用使用 java.beans 类的 jar(Introspector、BeanInfo 或 PropertyDescriptor)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用 java.beans.Introspectorjava.beans.BeanInfo 的 3rd 方 jar(我无法更改)和 java.beans.PropertyDescriptor.

I have 3rd party jar (which I can't change) that uses java.beans.Introspector, java.beans.BeanInfo and java.beans.PropertyDescriptor.

如何在我的 android 应用程序中使用该 jar?

从第 3 方 jar 加载类(使用 Introspector)失败:

It fails loading the class (which uses Introspector) from the 3th party jar:

WARN/dalvikvm(780): VFY: unable to resolve static method 6325: Ljava/beans/Introspector;.getBeanInfo (Ljava/lang/Class;)Ljava/beans/BeanInfo;
WARN/dalvikvm(780): VFY: unable to resolve exception class 962 (Ljava/beans/IntrospectionException;)
WARN/dalvikvm(780): Verifier rejected class Lorg/thirdpartyjar/SomeClass;

推荐答案

唯一的解决方案是维护噩梦:从源代码中分叉所有第 3 方 jar 并重写它们,以便它们不使用 java.beans.* 类(可能将它们替换为 openbeans).

The only solution is a maintenance nightmare: Fork all 3th party jars from source and rewrite them so they don't use java.beans.* classes (possibly by replacing them for openbeans).

然后,每次第 3 方 jar 中的一个发布修补程序(例如针对关键安全错误)时,重新.

Then, every time one of those 3th party jars releases a hotfix (for example for a critical security bug), do that all over again.

这篇关于使用使用 java.beans 类的 jar(Introspector、BeanInfo 或 PropertyDescriptor)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆