This is the video for the installation of the Google Data Java Client Library, basically the plugin for the mentioned for eclipse.
This is a part of the sample code
public class Documents {
public static void main(String[] args) {
try {
// Create a new Documents service
DocsService myService = new DocsService("My Application");
myService.setUserCredentials(args[0],args[1]);
// Get a list of all entries
URL metafeedUrl = new URL("http://docs.google.com/feeds/documents/private/full");
Now this code wont run because of the error in the line:
URL metafeedUrl = new URL("http://docs.google.com/feeds/documents/private/full");
The Error is:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
at com.google.gdata.wireformats.AltRegistry.
at com.google.gdata.wireformats.AltRegistry.
at com.google.gdata.client.Service.
at Documents.main(Documents.java:42)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 4 more
This should be default. So the final corrected URL becomes,
URL metafeedUrl = new URL("http://docs.google.com/feeds/default/private/full");
No comments:
Post a Comment