Started Using GoogleAPIs ?

I have recently tried out google apis and found this dazzling problem after importing all the jars documented in GoogleAPI documentation:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
at com.google.gdata.wireformats.AltRegistry.(AltRegistry.java:118)
at com.google.gdata.wireformats.AltRegistry.
(AltRegistry.java:100)
at com.google.gdata.client.Service.
(Service.java:555)
at TestDocumentList.main(TestDocumentList.java:14)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 4 more


Actually, in documentation they forgot about importing google-collect-1.0-rc1.jar. You can find this jar in gdata/bin/deps/google-collect-1.0-rc1.jar. Don't forget to add this in your build path.

No comments:

Post a Comment

Scheduling Repeating Local Notifications using Alarm Manager

Learn about Scheduling Repeating Local Notifications using Alarm Manager in this post .