My problem is somewhat similar as in here : Unable to resolve superclass error when referencing .jar library
I have tried the solution there, but not working for me.
So, First I created java source from WSDL
file using wsimport
. And added this source to Java project. Imported this java project as library to the Android project. Exported the library in Order and Export
in the build path. Tried different order for gen
and src
folders and also the library folder. When I call the method in the web service it does not work.
Here is the warning :
08-29 14:06:27.810: W/dalvikvm(20711): Unable to resolve superclass of Lcom/example/SampleService; (1270)
08-29 14:06:27.810: W/dalvikvm(20711): Link of class 'Lcom/example/SampleService;' failed
08-29 14:06:27.810: E/dalvikvm(20711): Could not find class 'com.example.SampleService', referenced from method com.example.demo.RequestSingleton
And also I get NoClassDefFoundError
for the class "SampleService.java" which is a generated class from the WSDL
and the subclass of javax.xml.ws.Service
.
Log :
08-29 14:06:27.815: E/AndroidRuntime(20711): FATAL EXCEPTION: AsyncTask #1
08-29 14:06:27.815: E/AndroidRuntime(20711): Process: com.example.demo, PID: 20711
08-29 14:06:27.815: E/AndroidRuntime(20711): java.lang.RuntimeException: An error occured while executing doInBackground()
08-29 14:06:27.815: E/AndroidRuntime(20711): at android.os.AsyncTask$3.done(AsyncTask.java:300)
08-29 14:06:27.815: E/AndroidRuntime(20711): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
08-29 14:06:27.815: E/AndroidRuntime(20711): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
08-29 14:06:27.815: E/AndroidRuntime(20711): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
08-29 14:06:27.815: E/AndroidRuntime(20711): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
08-29 14:06:27.815: E/AndroidRuntime(20711): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
08-29 14:06:27.815: E/AndroidRuntime(20711): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
08-29 14:06:27.815: E/AndroidRuntime(20711): at java.lang.Thread.run(Thread.java:841)
08-29 14:06:27.815: E/AndroidRuntime(20711): Caused by: java.lang.NoClassDefFoundError: com.example.SampleService
08-29 14:06:27.815: E/AndroidRuntime(20711): at com.example.demo.RequestSingleton.callWebService(RequestSingleton.java:52)
08-29 14:06:27.815: E/AndroidRuntime(20711): at com.example.demo.Request$callWebService.doInBackground(Request.java:104)
08-29 14:06:27.815: E/AndroidRuntime(20711): at com.example.demo.Request$callWebService.doInBackground(Request.java:1)
08-29 14:06:27.815: E/AndroidRuntime(20711): at android.os.AsyncTask$2.call(AsyncTask.java:288)
08-29 14:06:27.815: E/AndroidRuntime(20711): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
08-29 14:06:27.815: E/AndroidRuntime(20711): ... 4 more
I have also tried to create a jar from this java project and add it to the libs
folder in the Android project and added to the build path. Does not work.
I have also created an Android project with the WSDL
generated source and added this as library to the android application project. Does not work.
Tried importing the JRE Systrem Library
to the android project. Does not work either.
Can someone help me here?
Thanks in advance.