2012-07-25 104 views
1

我正在处理SUP MBO项目。我正尝试使用结果集过滤器来自定义我的MBO。在那个类中,我需要http获取一些东西,并根据反馈定制MBO行。我使用SUP2.1.2的MobileSDK并尝试预览结果集。我启用了调试并可以看到控制台的输出。httpclient.execute错误:java.lang.reflect.InvocationTargetException

更改后的结果组滤波码片看起来像:

@Override

公共结果集滤波器(在结果集,地图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)被调用,抛出异常如下:

0时06分42秒[错误] [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),但总是得到同样的失败。

有没有人有任何提示?谢谢。

回答

0

得到了解决,从here


嗨,

当Java编译器发现在2个不同的包装盒2不同的类具有相同名称的通常 “java.lang.reflect.InvocationTargetException” 的发生。当你一次导入两个类,并且尝试创建该类的对象时,它会抛出“java.lang.reflect.InvocationTargetException”异常。

解决方案是,当您创建类的使用包名以及类名的对象时,以便编译器知道它必须使用哪个类。

相关问题