com.google.gdata.client.GoogleService$CaptchaRequiredExcepti



我得到下面的错误,而执行gdata api样例代码。我是api的新手。请让我知道同样的解决方案。在哪里我需要把验证码和如何。

SEVERE: Authentication Error: Captcha requiredcom.google.gdata.client.GoogleService CaptchaRequiredException美元:需要验证码com.google.gdata.client.GoogleAuthTokenFactory.getAuthException (GoogleAuthTokenFactory.java: 623)在com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken (GoogleAuthTokenFactory.java: 500)在com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials (GoogleAuthTokenFactory.java: 346)在com.google.gdata.client.GoogleService.setUserCredentials (GoogleService.java: 362)在com.google.gdata.client.GoogleService.setUserCredentials (GoogleService.java: 317)在com.google.gdata.client.GoogleService.setUserCredentials (GoogleService.java: 301)在com.google.gdata.client.appsforyourdomain.audit.AuditService。(AuditService.java: 77)AuditSampleClient.main (AuditSampleClient.java: 100)

import java.util.Calendar;
import java.util.Properties;
import com.google.gdata.client.appsforyourdomain.audit.AuditService;
import com.google.gdata.client.appsforyourdomain.audit.MailBoxDumpRequest;
import com.google.gdata.data.TextConstruct;
import com.google.gdata.data.appsforyourdomain.AppsForYourDomainException;
import com.google.gdata.data.appsforyourdomain.generic.GenericEntry;
import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;
public class google_data {
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
            export_data();
    }
    public static void export_data()
    {
        MailBoxDumpRequest request = new MailBoxDumpRequest();
        request.setAdminEmailAddress("-----");
        request.setUserEmailAddress("----------");
        Calendar beginDate = Calendar.getInstance();
        beginDate.set(2011, Calendar.AUGUST, 1, 4, 30);
        request.setBeginDate(beginDate.getTime());
        Calendar endDate = Calendar.getInstance();
        endDate.set(2011, Calendar.AUGUST, 30, 20, 0);
        request.setEndDate(endDate.getTime());
        request.setIncludeDeleted(true);
        request.setSearchQuery("in:chat");
        request.setPackageContent("FULL_MESSAGE");
        AuditService service = null;
        try {
            service = new AuditService("-----", "------", "------", "-------auditapp-v1");
        } catch (AuthenticationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        GenericEntry mailboxDumpEntry = null;
        try {
            mailboxDumpEntry = service.createMailboxDumpRequest(request);
        } catch (AppsForYourDomainException 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();
        }
        TextConstruct requestId = mailboxDumpEntry.getSummary();
        System.out.println(requestId.toString());
        //String status = mailboxDumpEntry.getStatus();
        //String numberOfFiles = mailboxDumpEntry.getNumberOfFiles();
    }
}

这就是它所说的意思-服务要求用户在再次使用自动登录之前解决CAPTCHA。

异常应该包含相关验证码的URL。来自客户端登录用户指南:

来自ClientLogin的失败响应包含一个错误代码和一个可以显示给用户的错误页面的URL。如果错误代码是CAPTCHA质询,则响应还包括指向CAPTCHA图像的URL和一个特殊令牌。您的应用程序应该能够请求用户的回答,然后重试登录请求。

通过getCaptchaUrl()方法获取。

我得到了解决方案:

http://code.google.com/googleapps/faq.html handlingcaptcha

为什么我解锁管理员帐户后仍然得到CAPTCHA错误?

Please verify in your code that you are specifying your full administrator email address e.g. "admin@domain.com" instead of just "admin".

相关内容

  • 没有找到相关文章

最新更新