0

I am trying to create a Mantis client for Android using http://sourceforge.net/projects/mantisconnect/ Java client. I've created an empty Android project, added a Libs folder and but there a mantisconnect jar file. Then I've added it to the build path and moved it to the top.

try {
    mUrl = new URL("https://blabla.com:443/mantis/api/soap/mantisconnect.php");
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
try {
    IMCSession session = new MCSession(mUrl, mUser, mPwd);
    } catch (MCException e) {
        e.printStackTrace();
    }

This code is in OnClick event of the button. But when I click this button, I have an error:

06-07 10:38:47.818: I/dalvikvm(1000): Failed resolving Lorg/mantisbt/connect/axis/MantisConnectPortType; interface 118 'Ljava/rmi/Remote;'
06-07 10:38:47.818: W/dalvikvm(1000): Link of class 'Lorg/mantisbt/connect/axis/MantisConnectPortType;' failed
06-07 10:38:50.993: W/dalvikvm(1000): VFY: unable to find class referenced in signature (Lorg/mantisbt/connect/axis/MantisConnectPortType;)
06-07 10:38:53.856: I/dalvikvm(1000): Failed resolving Lorg/mantisbt/connect/axis/MantisConnectPortType; interface 118 'Ljava/rmi/Remote;'
06-07 10:38:53.856: W/dalvikvm(1000): Link of class 'Lorg/mantisbt/connect/axis/MantisConnectPortType;' failed
06-07 10:38:56.585: I/dalvikvm(1000): Failed resolving Lorg/mantisbt/connect/axis/MantisConnectPortType; interface 118 'Ljava/rmi/Remote;'
06-07 10:38:56.585: W/dalvikvm(1000): Link of class 'Lorg/mantisbt/connect/axis/MantisConnectPortType;' failed
06-07 10:39:04.045: W/dalvikvm(1000): VFY: unable to find class referenced in signature (Lorg/mantisbt/connect/axis/MantisConnectPortType;)
06-07 10:39:05.613: I/dalvikvm(1000): Failed resolving Lorg/mantisbt/connect/axis/MantisConnectPortType; interface 118 'Ljava/rmi/Remote;'
06-07 10:39:05.613: W/dalvikvm(1000): Link of class 'Lorg/mantisbt/connect/axis/MantisConnectPortType;' failed
06-07 10:39:22.073: W/dalvikvm(1000): Unable to resolve superclass of Lorg/mantisbt/connect/axis/MantisConnectLocator; (187)
06-07 10:39:22.073: W/dalvikvm(1000): Link of class 'Lorg/mantisbt/connect/axis/MantisConnectLocator;' failed
06-07 10:39:23.326: E/dalvikvm(1000): Could not find class 'org.mantisbt.connect.axis.MantisConnectLocator', referenced from method org.mantisbt.connect.axis.MCSession.createPortType
06-07 10:39:23.326: W/dalvikvm(1000): VFY: unable to resolve new-instance 251 (Lorg/mantisbt/connect/axis/MantisConnectLocator;) in Lorg/mantisbt/connect/axis/MCSession;
06-07 10:39:23.326: D/dalvikvm(1000): VFY: replacing opcode 0x22 at 0x0000
06-07 10:39:38.598: W/dalvikvm(1000): VFY: unable to resolve exception class 181 (Ljavax/xml/rpc/ServiceException;)
06-07 10:39:38.603: W/dalvikvm(1000): VFY: unable to find exception handler at addr 0xa
06-07 10:39:38.603: W/dalvikvm(1000): VFY:  rejected Lorg/mantisbt/connect/axis/MCSession;.createPortType (Ljava/net/URL;)Lorg/mantisbt/connect/axis/MantisConnectPortType;
06-07 10:39:38.603: W/dalvikvm(1000): VFY:  rejecting opcode 0x0d at 0x000a
06-07 10:39:38.603: W/dalvikvm(1000): VFY:  rejected Lorg/mantisbt/connect/axis/MCSession;.createPortType (Ljava/net/URL;)Lorg/mantisbt/connect/axis/MantisConnectPortType;
06-07 10:39:38.603: W/dalvikvm(1000): Verifier rejected class Lorg/mantisbt/connect/axis/MCSession;
06-07 10:39:41.807: D/AndroidRuntime(1000): Shutting down VM
06-07 10:39:41.807: W/dalvikvm(1000): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-07 10:39:41.996: E/AndroidRuntime(1000): FATAL EXCEPTION: main
06-07 10:39:41.996: E/AndroidRuntime(1000): java.lang.VerifyError: org.mantisbt.connect.axis.MCSession
06-07 10:39:41.996: E/AndroidRuntime(1000):     at daintel.issuereporter.Controls2$1.onClick(Controls2.java:51)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at android.view.View.performClick(View.java:2485)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at android.view.View$PerformClick.run(View.java:9080)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at android.os.Handler.handleCallback(Handler.java:587)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at android.os.Handler.dispatchMessage(Handler.java:92)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at android.os.Looper.loop(Looper.java:123)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at android.app.ActivityThread.main(ActivityThread.java:3683)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at java.lang.reflect.Method.invokeNative(Native Method)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at java.lang.reflect.Method.invoke(Method.java:507)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-07 10:39:41.996: E/AndroidRuntime(1000):     at dalvik.system.NativeStart.main(Native Method)

But this class is present in a package and I've wrote

import org.mantisbt.connect.axis.*;

in the activity class where the button event is. May you help me please?

Taras
  • 391
  • 4
  • 10

1 Answers1

1

06-07 10:39:38.598: W/dalvikvm(1000): VFY: unable to resolve exception class 181 (Ljavax/xml/rpc/ServiceException;)

You're missing some libraries from your classpath. I suggest that:

  1. You use the jar from http://search.maven.org/#artifactdetails|biz.futureware.mantis|mantis-axis-soap-client|1.2.9|jar ; it works better with more recent Mantis versions
  2. Add the apache axis 1.4 jar to your classpath as well.
Robert Munteanu
  • 67,031
  • 36
  • 206
  • 278
  • I tried http://search.maven.org/#artifactdetails|biz.futureware.mantis|mantis-axis-soap-client|1.2.9|jar But there is no documentation on how to use it. – Taras Jun 08 '12 at 08:41
  • Just include it in the classpath and use its classes. But don't forget the axis jar – Robert Munteanu Jun 08 '12 at 09:16
  • But it uses java.rmi which can't be used in Android application. The simpliest code like `URL url = new URL(MUrl); MantisConnectLocator mcl = new MantisConnectLocator(); MantisConnectPortType portType = mcl.getMantisConnectPort(url); String vers = portType.mc_version();` raises an error `The project was not built since its build path is incomplete. Cannot find the class file for java.rmi.RemoteException. Fix the build path then try building this project` – Taras Jun 08 '12 at 12:54