1

did you encounter this error before NoClassDefFoundError ? It cannot find a class from my android project(that is not an activity, just a normal class) at runtime, but it finds at compile time. How can I debug this further more? I don't use the class in another project, or from another project. My class extends javax.xml.ws.Service and I imported the jre library in my application to recognize the jaxa.xml package. Could it be from this import? Thank you.

Gabi Radu
  • 1,107
  • 2
  • 16
  • 35

1 Answers1

2

Importing the jre library into your project will not work on android, as your code will compile but the dalvik vm (which is different from a normal sun jdk) will not find the jre classes as long as they are not included in the android environment. Android might look like Java but it isn't Java.

You're getting the NoClassDefFoundError because the VM can't find the interface your class implements and therefor can't load it. If you want to use soap in your android app, google a bit about it, I think there are several topics here covering this issue.

HefferWolf
  • 3,894
  • 1
  • 23
  • 29
  • I have generated stub classes, which work(tested from a new Java project app) to communicate with the server and retrieve info.. And not while placing the classes in the Android project I run into a lot of problems.. – Gabi Radu Feb 01 '12 at 13:44
  • Again: this will not work, Java has soap support builtin (and you used to compile it), but android has not, have a look here which explains in detail how to use SOAP in android: http://stackoverflow.com/questions/297586/how-to-call-soap-web-service-with-android – HefferWolf Feb 01 '12 at 14:24
  • thank you, unfortunately my first try was with ksoap :D it was ok till the moment i wanted to authenticate to a SAP server, it just didn't want to, and the credentials were correct. That is why i tried another method :D – Gabi Radu Feb 01 '12 at 14:35