My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
TemplateDemo  
Steps on how to create a new Google Data template
Featured
Updated Feb 4, 2010 by kunalmsh...@gmail.com

Introduction

This page demonstrates how to create a new Google Data template of your choice in a few steps using the Google Data plug-in.

Steps to create a new Google Data Template

For demonstration purpose, we will create a new Google Documents template which uses the Google Documents List Data API.

  • Step 1: Go to File --> New --> Others
  • Step 2: A new project wizard will open up. Scroll until you find a folder named 'Google Data'. Expand it and click on 'Google Data Project' and then click next.
  • Step 3: A Google Data Project wizard page will open up which will ask for some information to create a new Google Data Project.

  • Step 4: We will now enter appropriate information.
    • Enter a valid project name. Say: My Document Project
    • Select the 'Documents' template from the template list. You can see a corresponding description of the selected template next to the template list.
    • Now, click on the 'Browse' button to select a directory containing the GData Java Client Lib files i.e. something like .../gdata/java/lib
    • Now, since the description says that the 'Documents' template will require external dependencies, we need to select either the 'Download dependencies to' option or the 'Select Location' option. If you do not have the required dependencies on your system, you can select to download them.

  • Step 5: After filling in the required information, click on 'Finish' button.
  • Step 6: A new Java project is created in the workspace with the project name you provided. The Documents template named 'Documents.java' will be opened for editing. It will have instructions on how to execute it. All the required dependencies are referenced as 'Referenced Libraries'. If you are a new Eclipse user, click here to know how to set the execution arguments.
Comment by lama.yaz...@gmail.com, May 7, 2009

in step 2 when I click next an error message occurs : "The selected wizard could not be started.

Plug-in "com.google.gdata" was unable to instantiate class "com.google.gdata.devtools.eclipse.ui.NewProjectWizard?". java.lang.NullPointerException?
"

Comment by project member kunalmsh...@gmail.com, May 12, 2009

Please file it as an issue with details of the problem, OS and Eclipse version. We'll carry it forward from there.

Comment by ignaz...@gmail.com, Jun 9, 2009

I use ubuntu 9.04 and eclipse 3.2.2 eclipse works fine and i'm trying to install the google data plug-in following your instruction. but after restart eclipse there isn't "google data" folder in "new->other" menu. what is the problem? can you help me? there is a screenshoot thank you.

Comment by project member kunalmsh...@gmail.com, Jun 21, 2009

This plug-in requires Eclipse v3.3 or above. The requirements are listed on the Installation wiki.

Comment by toniaz...@gmail.com, Jul 7, 2009

Please, i need help. When i tried to execute the class, i had the follow error message:

Exception in thread "main" java.lang.NoClassDefFoundError: 
	at Documents.main(Documents.java:36)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps

Thanks for help

Comment by steve.j....@gmail.com, Jul 26, 2009

A gdata dependency on two jars found in the "deps" folder of the java gdata download was introduced a month or two ago. Add these two jars to your classpath and you will be good to go. The particular Maps class you are looking for is found in the google-collect-1.0-rc1 jar, which is one of those two dependencies.

Cheers.

Comment by yrnchowd...@gmail.com, Oct 29, 2009

Hi,

After setting the Classpath with the specified Jars also, i am getting the same exception as Mr.Toniazzom. Could you please help me?

Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/common/collect/Maps

at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:118) at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:100) at com.google.gdata.client.Service.<clinit>(Service.java:532) at Documents.main(Documents.java:36)

This is My Classpath: (both UserVariables? and System Variables are set)

%JAVA_HOME%\lib;D:\GDataApp\gdata-samples.java-1.39.0\gdata\java\deps;.;

I tried giving the Classpath till the Jars as below: %JAVA_HOME%\lib;D:\GDataApp\gdata-samples.java-1.39.0\gdata\java\deps;D:\GDataApp\gdata-samples.java-1.39.0\gdata\java\deps\jsr305.jar;D:\GDataApp\gdata-samples.java-1.39.0\gdata\java\deps\google-collect-1.0-rc1.jar;.;

I also tried copying the google-collect-1.0-rc1.jar and jsr305.jar onto my External Jars Location(which we give at the time of creating the Project). Even then also i got the same problem.

Could you please suggest me some solution for this?

Thanks in advance, Ravindanath Y

Comment by ko7et2...@gmail.com, Nov 21, 2009

i dont know what is the problem

everytime i try to run this i found this error

Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/common/collect/Maps

at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:118) at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:100) at com.google.gdata.client.Service.<clinit>(Service.java:532) at AppsProvisioning?.main(AppsProvisioning?.java:37)
Caused by: java.lang.ClassNotFoundException?: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController?.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader?.loadClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) at java.lang.ClassLoader?.loadClassInternal(Unknown Source) ... 4 more

ppppplllllllllllllllllllllllllllllllllllllz help

Comment by smcauli...@akgroup.com, Nov 24, 2009

I'm having the same problem too. Within Program Arguments are you passing the following arguments: arg0? = username arg1? = password. Reading Eclipse for dummies it says that you can put the username and password seperated by a space in the Program arguments and it will automatically associate arg0? with the first entry and arg1? with the second entry.

Comment by solaj...@gmail.com, Dec 1, 2009

Hi, You seems to be missing the some core components in your path. This includes "google-collect-1.0-rc1.jar" and "jsr305.jar". Ensure you have these two required jars, rebuild and try again...

They are both available within the "deps" folder of the "Google Data Java Client Library". You can get the latest gdata library here... http://code.google.com/p/gdata-java-client/downloads/list

Comment by weiwenx...@gmail.com, Dec 9, 2009

Hi, Every time I run,I found this error: Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/common/collect/Maps

at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:118) at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:100) at com.google.gdata.client.Service.<clinit>(Service.java:548) at Documents.main(Documents.java:36)
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

I run this project as "java application", could you show me how to configure 'run configurations', thanks!

Comment by weiwenx...@gmail.com, Dec 11, 2009

I have resloved this question, lack of google-collect-<version>.jar, "add external jars" this jar, it works well.

Comment by victoreu...@gmail.com, Feb 13, 2010

Thanks weiwenxing..

Comment by pa.sun...@gmail.com, Feb 20, 2010

Hi I am new to java, tried this and Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/common/collect/Maps

at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:118) at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:100) at com.google.gdata.client.Service.<clinit>(Service.java:548) at Documents.main(Documents.java:36)
Caused by: java.lang.ClassNotFoundException?: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController?.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader?.loadClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) ... 4 more

Comment by vinkoi...@gmail.com, Apr 5, 2010

Hi I am a beginner for java, When I run this template, Exception appear:

Getting Documents entries...

com.google.gdata.util.ResourceNotFoundException?: Not Found <HTML> <HEAD> <TITLE>Not Found</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Not Found</H1> <H2>Error 404</H2> </BODY> </HTML>

at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:587) at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563) at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:550) at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530) at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535) at com.google.gdata.client.Service.getFeed(Service.java:1102) at com.google.gdata.client.Service.getFeed(Service.java:965) at com.google.gdata.client.GoogleService?.getFeed(GoogleService?.java:631) at com.google.gdata.client.Service.getFeed(Service.java:984) at Documents.main(Documents.java:48)

What can I fix it?

Comment by texis...@gmail.com, Apr 8, 2010

Hola, me llamo jim. El tutorial esta perfecto, pero me sale un error, espero y me ayuden. En la cosola me aparese lo siguiente: Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/common/collect/Maps

at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:118) at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:100) at com.google.gdata.client.Service.<clinit>(Service.java:546) at Documents.main(Documents.java:36)

Espero y me ayuden

Comment by a.martin...@gmail.com, Apr 13, 2010

for vinkoiipm just change the default URI of the example by https://docs.google.com/feeds/default/private/full

it's work for me.

Comment by anders...@gmail.com, Apr 14, 2010

Thank a.martinexhighes! I was getting same error as vinkoiipm. your solution fixed.

Comment by lagrott...@gmail.com, May 17, 2010

I have added the two jars you suggested, but nothing changed, I still continue to get this error: Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/common/collect/Maps

at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:118) at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:100) at com.google.gdata.client.Service.<clinit>(Service.java:555) at CalendarTest?.main(CalendarTest?.java:18)
Caused by: java.lang.ClassNotFoundException?: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController?.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source)

Any help please?

Comment by longyin...@163.com, Jul 6, 2010

I want to say Chinese ! But afraid your don't understand ~I can't speak English

Comment by follybea...@gmail.com, Jul 26, 2010

sometimes a quick 1,2,3 tutorial does wonders when you're trying to rush through. I have managed to run this tutorial thanks to the initial instructions supplemented by helpful commentary, but a quick run-through is available at chriscargile.com/2010/gdata.html, in case someone's stuck.

Comment by mr.n...@gmail.com, Aug 9, 2010

I have to do application on Android's mobile, which application is PicasaWebService? but I complie many error commands: - The First: PicasaWebService? myService = new PicasaWebSerivce?("google-PicasaWeb?-2.0"); - The Seconds: Service service = new Service(); - The Thirds: GoogleService? service = new GoogleService?("lh2","google-picasaWebService-2.0"); ............. All commands always be error is:

Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/common/collect/Maps

at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:118) at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:100) at com.google.gdata.client.Service.<clinit>(Service.java:555) at AppsProvisioning?.main(AppsProvisioning?.java:34)
Caused by: java.lang.ClassNotFoundException?: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController?.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader?.loadClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) ... 4 more

I searched many on internet but didn't resolve, I hope people to help me. Thankyou very much

Comment by ikillb...@gmail.com, Feb 13, 2011

Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/common/collect/Maps

at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:118) at com.google.gdata.wireformats.AltRegistry?.<init>(AltRegistry?.java:100) at com.google.gdata.client.Service.<clinit>(Service.java:555) at Calendar.main(Calendar.java:36)
Caused by: java.lang.ClassNotFoundException?: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController?.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader?.loadClass(Unknown Source) at java.lang.ClassLoader?.loadClass(Unknown Source) ... 4 more

Comment by bkuny...@gmail.com, Mar 3, 2011

A gdata dependency on two jars found in the "deps" folder of the java gdata download was introduced a month or two ago. Add these two jars to your classpath and you will be good to go. The particular Maps class you are looking for is found in the google-collect-1.0-rc1 jar, which is one of those two dependencies.

If you are using Eclipse, on your "Referenced Libraries" add external jars to the list and you will be okay

Comment by npogr...@gmail.com, Mar 9, 2011

Hello,

I continue to get the following error when using this example:

/DocAction??action=unsupported_browser&gsessionid=lMySzcbpHNgKz34s230

Has anybody else experienced this.

Niall

Comment by mecools...@gmail.com, Mar 22, 2011
Hi, Every time I run,I found this error: java.lang.VerifyError?: com.google.gdata.client.media.MediaService?

help

Comment by surendra...@gmail.com, Oct 14, 2011

Hi...I'm trying to implement this using Eclipse 3.6 and it will not showing me some option at time of installation. May be due to this I'm not able to install it properly. Could some one help me to find out solution of this.

Thanks in advance.

Comment by long.ngu...@c-mg.com, Nov 2, 2011

I've create the project following this thread but i got an error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException?: 0

at Documents.main(Documents.java:37)

Somebody help me, please.

Comment by pbiteste...@gmail.com, Feb 26, 2012

Hey, I'm getting that same error everyone else is getting.

Caused by: java.lang.ClassNotFoundException?: com.google.common.collect.Maps

I have those libraries uploaded too. google-collect-1.0-rc1.jar and jsr305.jar along with all the other ones I'm suppose to be referencing. This is the line where it's crashing.

CalendarService? myService = new CalendarService?("exampleCo-exampleApp-1");

Comment by GANDHRE....@gmail.com, Mar 23, 2012

com.google.gdata.util.ResourceNotFoundException?: Not Found Document not found.

at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:591) at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563) at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552) at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530) at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535) at com.google.gdata.client.media.MediaService?.getMediaResource(MediaService?.java:234) at com.google.gdata.client.media.MediaService?.getMedia(MediaService?.java:276) at com.google.gdata.client.media.MediaService?.getMedia(MediaService?.java:302) at sample.docs.DocumentList?.downloadFile(DocumentList?.java:531) at sample.docs.DocumentList?.downloadDocument(DocumentList?.java:626)
Comment by michael....@gmail.com, Apr 20, 2012

include \gdata\java\deps\guava-11.0.2.jar into your dependencies and could run...


Sign in to add a comment
Powered by Google Project Hosting