2011-08-03 15 views
0

googleカレンダーのapi jarsをGoogleが提供するeclipseプラグインを使用して現在のプロジェクトにインポートしました。ここeclipseプラグインを使用してGoogleカレンダーのAPIの問題をインポートします。

は私がhttp://code.google.com/eclipse/docs/googleapis.html

それをやったし、ここで私は、コンパイル時にエラーが発生した私は

http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html

を行うにしようとしています何であるかです。コンソールウィンドウ

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: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) 
    ... 4 more 

から

エラー

Compiling module com.shuttle.reservation.ShuttleWebsite 
    Validating newly compiled units 
     [ERROR] Errors in 'file:/C:/Users/user1/Desktop/Dropbox/All/Everything%20Programming/workspace/ShuttleWebsite/src/com/shuttle/reservation/client/ShuttleWebsite.java' 
     [ERROR] Line 129: No source code is available for type com.google.gdata.client.calendar.CalendarService; did you forget to inherit a required module? 
     [ERROR] Line 134: No source code is available for type java.net.URL; did you forget to inherit a required module? 
     [ERROR] Line 135: No source code is available for type com.google.gdata.data.calendar.CalendarFeed; did you forget to inherit a required module? 
     [ERROR] Line 142: No source code is available for type com.google.gdata.data.calendar.CalendarEntry; did you forget to inherit a required module? 
     [ERROR] Line 146: No source code is available for type com.google.gdata.util.AuthenticationException; did you forget to inherit a required module? 
     [ERROR] Line 149: No source code is available for type java.net.MalformedURLException; did you forget to inherit a required module? 
     [ERROR] Line 155: No source code is available for type com.google.gdata.util.ServiceException; did you forget to inherit a required module? 
    Finding entry point classes 
     [ERROR] Unable to find type 'com.shuttle.reservation.client.ShuttleWebsite' 
     [ERROR] Hint: Previous compiler errors may have made this type unavailable 
     [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly 

いくつかの追加のエラーをコーディングし、ここにコードされている間、私はエラーまたは警告を取得していないと私は何をすべきかを知りません。私はGoogleのプラグインの設定私のプロジェクトを私はなぜそれが動作していない知っていないeclipseプラグインを使用します。あなたは私を助けることができます

import com.google.gdata.client.*; 
import com.google.gdata.client.calendar.*; 
import com.google.gdata.data.*; 
import com.google.gdata.data.acl.*; 
import com.google.gdata.data.calendar.*; 
import com.google.gdata.data.extensions.*; 
import com.google.gdata.util.*; 

import java.net.*; 
import java.io.*; 

. 
. 
. 
. 
//------------ Calendar Service --------------------------------------------- 
     CalendarService myService = new CalendarService("exampleCo-exampleApp-1.0"); 

     try { 
      myService.setUserCredentials("[email protected]", "mypassword"); 

      URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/allcalendars/full"); 
      CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class); 

      textBox.setText("Your calendars"); 
      //System.out.println("Your calendars:"); 
      //System.out.println(); 

      for (int i = 0; i < resultFeed.getEntries().size(); i++) { 
       CalendarEntry entry = resultFeed.getEntries().get(i); 
       //System.out.println("\t" + entry.getTitle().getPlainText()); 
       textBox_1.setText(entry.getTitle().getPlainText()); 
      } 
     } catch (AuthenticationException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } catch (MalformedURLException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } catch (IOException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } catch (ServiceException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 
    } 

. 
. 
. 

答えて

0

あなたは範囲を取得できませんでした。 GWTはすべてのJavaクラスをクライアントコードにインポートできません。 CalendarServiceや他のCalendar APIクラスのようなものは、クライアント側ではなく、サーバ側で記述されているはずです。

慎重にチュートリアルを読んでください。サーバーとクライアントのコードを混在させてください。

関連する問題