1

I am working on an SUP MBO project. I am trying to use a Result Set Filter to customize my MBO. In that class, I need http get something and customize the MBO rows based on the feedback. I use MobileSDK of SUP2.1.2 and try preview the resultset. I enabled the debugging and can see the output from the console.

The changed result set filter code piece looks like:

@Override

public ResultSet filter(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;

}

Each time when httpclient.execute(httpGet) gets called, an exception is thrown out as below:

00:06:42 [ERROR] [ExecuteSection]: Execution error

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)
...

Caused by: java.lang.VerifyError: Cannot inherit from final class

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)

I tried different httpclient jar versions (including 3.0.1, 4.2) but always got the same failure.

Does anyone have any hint? Thanks.

Leon
  • 11
  • 4

1 Answers1

0

Got the solution from here


Hi,

Normally "java.lang.reflect.InvocationTargetException" occurs when java compiler finds 2 different classes with same name in 2 different packages. when u r importing both classes at a time and when you r trying to create object of that class it throws "java.lang.reflect.InvocationTargetException" exception .

The solution is that when you are creating the object of the class use package name also along with class name so that compiler knows what class it has to use.

Nigel Crasto
  • 318
  • 3
  • 8