Android Mantis客户端“找不到类”错误

时间:2012-06-07 11:50:37

标签: java android soap mantis

我正在尝试使用http://sourceforge.net/projects/mantisconnect/ Java客户端为Android创建一个Mantis客户端。 我创建了一个空的Android项目,添加了一个Libs文件夹,但是有一个mantisconnect jar文件。然后我将它添加到构建路径并将其移动到顶部。

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();
    }

此代码位于按钮的OnClick事件中。但是当我点击这个按钮时,我有一个错误:

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)

但是这个类出现在一个包中,我写了

import org.mantisbt.connect.axis.*;

在按钮事件所在的activity类中。你可以帮帮我吗?

1 个答案:

答案 0 :(得分:1)

  

06-07 10:39:38.598:W / dalvikvm(1000):VFY:无法解析异常类181(Ljavax / xml / rpc / ServiceException;)

你遗漏了类路径中的一些库。我建议:

  1. 你使用http://search.maven.org/#artifactdetails|biz.futureware.mantis|mantis-axis-soap-client|1.2.9|jar的jar;使用最新的Mantis版本可以更好地使用
  2. 也将apache axis 1.4 jar添加到类路径中。