我正在做一个 SUP MBO 项目。我正在尝试使用结果集过滤器来自定义我的 MBO。在那个类中,我需要 http 获取一些东西并根据反馈自定义 MBO 行。我使用 SUP2.1.2 的 MobileSDK 并尝试预览结果集。我启用了调试,可以看到控制台的输出。
更改后的结果集过滤器代码片段如下所示:
@覆盖
公共 ResultSet 过滤器(ResultSet in,Map arg1)
throws Exception {
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet("www.google.com");
HttpResponse response1 = httpclient.execute(httpGet);
httpGet.releaseConnection();
return in;
}
每次调用 httpclient.execute(httpGet) 时,都会抛出一个异常,如下所示:
00:06:42 [ERROR] [ExecuteSection]:执行错误
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
at com.sybase.uep.tooling.ui.dialogs.preview.ExecuteSection.execute(ExecuteSection.java:227)
...
原因:java.lang.VerifyError:无法从最终类继承
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
...
at com.sybase.uep.tooling.ui.dialogs.preview.ExecuteSection$4.run(ExecuteSection.java:207)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
我尝试了不同的 httpclient jar 版本(包括 3.0.1、4.2),但总是失败。
有没有人有任何提示?谢谢。