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

153 views
Skip to first unread message

Koen Maes

unread,
May 28, 2012, 7:04:33 PM5/28/12
to google-api-...@googlegroups.com

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

Steve Ziegler

unread,
May 29, 2012, 1:43:27 PM5/29/12
to google-api-...@googlegroups.com
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.

Koen Maes

unread,
May 29, 2012, 4:46:03 PM5/29/12
to google-api-...@googlegroups.com
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

Yaniv Inbar (יניב ענבר)

unread,
Jun 1, 2012, 9:51:30 PM6/1/12
to google-api-...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages