I'm getting an invalidRequestUri on every request I make using the java client

504 views
Skip to first unread message

John Doe

unread,
Mar 24, 2012, 9:45:24 PM3/24/12
to google-docum...@googlegroups.com
When I run:

    private void go() throws Exception {
        DocsService client = new DocsService("appname");
        client.setUserCredentials("user", "password");
        DocumentListFeed feed = client.getFeed(new URL("https://docs.google.com/feeds/default/private/full/"), DocumentListFeed.class);
    }

I get this error response:

Exception in thread "main" com.google.gdata.util.InvalidEntryException: Invalid request URI
<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>invalidRequestUri</code><internalReason>Invalid request URI</internalReason></error></errors>

    at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:558)
    at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:543)
    at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:536)
    at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:515)
    at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:515)
    at com.google.gdata.client.Service.getFeed(Service.java:1053)
    at com.google.gdata.client.Service.getFeed(Service.java:916)
    at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
    at com.google.gdata.client.Service.getFeed(Service.java:935)

Why is this?  Even when I run the client demo, I get this exception. 
Message has been deleted

Claudio Cherubino

unread,
Mar 26, 2012, 4:22:59 PM3/26/12
to google-docum...@googlegroups.com
Hi John,

You need to specify the API version in your requests, by adding the GData-Version: 3.0 header, or the ?v=3 URL parameter:


Claudio

Claudio Cherubino

unread,
Mar 27, 2012, 11:53:28 AM3/27/12
to google-docum...@googlegroups.com
Hi John,

You can checkout the latest version of the source from:


Claudio

On Sat, Mar 24, 2012 at 9:26 PM, John Doe <tie...@gmail.com> wrote:
Solved this.  I was using an old version of the library that I got from a maven repository.  I was using 1.36.  Is there an up to date maven repo where I can get these libraries?

Dan Kaplan

unread,
Mar 28, 2012, 2:42:32 AM3/28/12
to google-docum...@googlegroups.com
Yes, I did that.  But it would be more convenient if it were available on maven FYI.  This issue FWIW: http://code.google.com/p/gdata-java-client/issues/detail?id=328&q=maven
Reply all
Reply to author
Forward
0 new messages