我正在尝试使用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.*;
在按钮事件所在的活动类中。你能帮帮我吗?