2011-09-14 33 views
0

我想我成功使用flickrj之前,但我這次卡住了。flickrj PhotosetsInterface.getPhotos

Flickr flickr = new Flickr("apikey"); 
     PhotosetsInterface photosetInterface = flickr.getPhotosetsInterface(); 
     PhotoList photos = null; 
     try { 
      photos = photosetInterface.getPhotos("setKey",10,1); 
      Iterator<Photo> itr = photos.iterator(); 
      while(itr.hasNext()){ 
       Photo photo = (Photo) itr.next(); 
       out.println("the url of the photo is "+photo.getTitle()+"<br/>"); 
      } 
     } catch (SAXException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } catch (FlickrException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 

當我運行這個我得到這個錯誤廣告下面,我使用谷歌appengine。

com.aetrion.flickr.FlickrException: 96: Invalid signature 
    at com.aetrion.flickr.photosets.PhotosetsInterface.getPhotos(PhotosetsInterface.java:437) 
    at com.aetrion.flickr.photosets.PhotosetsInterface.getPhotos(PhotosetsInterface.java:479) 
    at dassio.FlickrPage.doGet(FlickrPage.java:34) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) 
    at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35) 
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58) 
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) 
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 
    at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122) 
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 
    at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97) 
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) 
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) 
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 
    at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) 
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:351) 
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 
    at org.mortbay.jetty.Server.handle(Server.java:326) 
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) 
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) 
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) 
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 

,我能夠與端點聯繫,並獲得集列表,所以我真的不知道爲什麼一個無效的簽名。

回答

0

找到你必須提供密鑰與Flikcr施工方法的問題:

Flickr flickr = new Flickr("apikey","secretkey");