jar dependencies in android- no class definition found exception
Posted
by Dave.B
on Stack Overflow
See other posts from Stack Overflow
or by Dave.B
Published on 2010-03-29T16:21:31Z
Indexed on
2010/03/29
16:23 UTC
Read the original article
Hit count: 253
I'm trying to use the gdata java client library on android and have managed a decent hack to get it working. However because the jar for gdata had some package discrepancies with android I had to import the source into my project. This source is dependent on the JavaMail API and the JavaBeans Activation Framework as specified here.
My issue is that the JavaMail jar throws a class definition not found when seeking a class which is in the Activation Framework jar. A stack trace is listed below. I am working in Eclipse and have both jars in a lib folder and added to my build path. I'm not very experienced dealing with jars in a situation like this so any help or insight would be appreciated.
03-29 09:55:26.204: ERROR/AndroidRuntime(331): Uncaught handler: thread AsyncTask #3 exiting due to uncaught exception
03-29 09:55:26.215: ERROR/AndroidRuntime(331): java.lang.RuntimeException: An error occured while executing doInBackground()
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at android.os.AsyncTask$3.done(AsyncTask.java:200)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at java.lang.Thread.run(Thread.java:1096)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): Caused by: java.lang.NoClassDefFoundError: javax.activation.DataHandler
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at javax.mail.internet.MimeBodyPart.setContent(MimeBodyPart.java:684)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at com.google.gdata.data.media.MediaBodyPart.<init>(MediaBodyPart.java:95)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at com.google.gdata.data.media.MediaMultipart.<init>(MediaMultipart.java:126)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at com.google.gdata.client.media.MediaService.insert(MediaService.java:382)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at android.os.AsyncTask$2.call(AsyncTask.java:185)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
© Stack Overflow or respective owner