Cannot create instance of UrlFetchTransport - google-api-java-client 1.8.0 / 1.9.0-beta since GAE SDK 1.6.6

Showing 1-4 of 4 messages
Cannot create instance of UrlFetchTransport - google-api-java-client 1.8.0 / 1.9.0-beta since GAE SDK 1.6.6 Koen Maes 5/28/12 4:04 PM

Since GAE SDK 1.6.6, my previously working code (GAE SDK 1.6.5) is not working anymore. The problem is related to the creation of UrlFetchTransport. I reduced the problem to the bare minimum in a BadClassTest class;

When my BadClassTest looks like this :

public class BadClassTest {

    public BadClassTest() {
        com.google.api.client.http.HttpTransport HTTP_TRANSPORT = new com.google.api.client.extensions.appengine.http.urlfetch.UrlFetchTransport();
    }

}

then I can create an instance.

When my BadClassTest looks like this :

public class BadClassTest {

    com.google.api.client.http.HttpTransport HTTP_TRANSPORT = new com.google.api.client.extensions.appengine.http.urlfetch.UrlFetchTransport();

    public BadClassTest() {
        //com.google.api.client.http.HttpTransport HTTP_TRANSPORT = new com.google.api.client.extensions.appengine.http.urlfetch.UrlFetchTransport();
    }

}

cannot create an instance of BadClassTest now. I run into following exception :

java.lang.VerifyError: (class: com/klawt/server/BadClassTest, method: signature: ()V) Bad type in putfield/putstatic


see also : http://stackoverflow.com/questions/10764671/verifyerror-after-upgrading-to-appengine-1-6-6-cannot-create-instance-of-urlfet

Re: Cannot create instance of UrlFetchTransport - google-api-java-client 1.8.0 / 1.9.0-beta since GAE SDK 1.6.6 Steve Ziegler 5/29/12 10:43 AM
We experienced this as well.  However, since I believe that GAE now fully supports the httpclient-backed NetHttpTransport (someone correct me if I'm wrong), we switched over to it and haven't been having any issues with the change over.
Re: Cannot create instance of UrlFetchTransport - google-api-java-client 1.8.0 / 1.9.0-beta since GAE SDK 1.6.6 Koen Maes 5/29/12 1:46 PM
Hi Steve,

I replace UrlFetchTransport with NetHttpTransport and it works !! That's great news... I have been banging my head over this for 5 days. Deployed the app to appengine and it works in production too so all fine :)

UrlFetchTransport is completely obsolete now I guess ?

Koen
Re: Cannot create instance of UrlFetchTransport - google-api-java-client 1.8.0 / 1.9.0-beta since GAE SDK 1.6.6 Yaniv Inbar 6/1/12 6:51 PM
Thanks for the feedback!

I gave a detailed answer on stackoverflow.  Please read it there for a work-around:


Yaniv Inbar
Senior Software Engineer
Google Inc.