2012-04-12 140 views
0

我正在使用grails和google youtube api(https://developers.google.com/youtube/2.0/developers_guide_java#AuthSub_for_Web_Applications)來獲取用戶上傳的視頻的詳細信息。但只要我嘗試初始化YouTubeService類爲:無法初始化com.google.gdata.client.youtube.YouTubeService類

String emailID="[email protected]"//this is the id with which i registered for developer key 
String DeveloperKey="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" //developer key given by google 
YouTubeService service=new YouTubeService(emailID,DeveloperKey) 
//I am done using appName,clientId(given by google) as the first parameter to the 
YouTubeService but nothing helped 

它給了我下面的錯誤:

Class java.lang.ClassNotFoundException 
Message com.google.gdata.data.media.MediaMultipart 
//I can see this MediaMultipart file in the said destination in one of the included jars. 
Originally it was complaining about com.google.collections.common.Maps but then i 
added google.collections.1-rc.jar. I also tried adding guava.jar as read from various 
forums but that could not solve my problem 

如果我重新載入頁面,錯誤修改

Class java.lang.NoClassDefFoundError 
Message Could not initialize class com.google.gdata.client.youtube.YouTubeService 

我已經包括了所有需要的罐子(http://code.google.com/p/gdata-java-client/downloads/list),但是這個問題沒有得到解決。請幫忙。

回答

0

嘗試添加gdata-java-client所需的javax.mailcom.google.guava依賴關係。

+0

我試過了,但即使這樣也行不通。 – user1304683 2012-10-13 09:17:31

相關問題