2012-04-25 60 views
0

安裝Apache Tomcat,Apache Axis2,創建web項目,轉換爲服務,在Tomcat中部署它,然後創建客戶端項目,然後創建包含我們服務的存根的客戶端,最後訪問服務。消費webservice時發生的問題

我想這些都是使用Android Eclipse上的Web服務的所有步驟。
這裏我完成了在tomcat服務器上部署web項目的步驟,它顯示了有關服務的成功,但服務器選項顯示爲SYNCHRONIZED。它給下面

服務器在本地主機

的Tomcat V6.0服務器[開始,花樣]

AndBack [同步。


同時創建客戶端項目後,在運行時,如圖起來:

Sorry! The application has stopped unexpectedly. Please try again. Force close

請參考下面給出我的logcat的。

logcat的

04-25 16:46:51.153: E/dalvikvm(273): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method org.test.Frontend.AndFrontActivity.onCreate 
04-25 16:46:51.153: W/dalvikvm(273): VFY: unable to resolve new-instance 25 (Lorg/ksoap2/serialization/SoapObject;) in Lorg/test/Frontend/AndFrontActivity; 
04-25 16:46:51.153: D/dalvikvm(273): VFY: replacing opcode 0x22 at 0x0010 
04-25 16:46:51.164: D/dalvikvm(273): VFY: dead code 0x0012-0081 in Lorg/test/Frontend/AndFrontActivity;.onCreate (Landroid/os/Bundle;)V 
04-25 16:46:51.243: D/AndroidRuntime(273): Shutting down VM 
04-25 16:46:51.243: W/dalvikvm(273): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 
04-25 16:46:51.273: E/AndroidRuntime(273): FATAL EXCEPTION: main 
04-25 16:46:51.273: E/AndroidRuntime(273): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject 
04-25 16:46:51.273: E/AndroidRuntime(273): at org.test.Frontend.AndFrontActivity.onCreate(AndFrontActivity.java:28) 
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 
04-25 16:46:51.273: E/AndroidRuntime(273): at android.os.Handler.dispatchMessage(Handler.java:99) 
04-25 16:46:51.273: E/AndroidRuntime(273): at android.os.Looper.loop(Looper.java:123) 
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.main(ActivityThread.java:4627) 
04-25 16:46:51.273: E/AndroidRuntime(273): at java.lang.reflect.Method.invokeNative(Native Method) 
04-25 16:46:51.273: E/AndroidRuntime(273): at java.lang.reflect.Method.invoke(Method.java:521) 
04-25 16:46:51.273: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 
04-25 16:46:51.273: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 
04-25 16:46:51.273: E/AndroidRuntime(273): at dalvik.system.NativeStart.main(Native Method) 

回答

1

原來外部罐如

ksoap2-機器人組裝-2.6.2-罐與 - dependencies.jar

到下放到/ libs文件夾,以便Eclipse ADT自動將您的jar添加到應用程序的構建路徑中。這是一個buildpath缺少定義的類錯誤..我希望這也能幫助你!

herethere