Code breaks with upgrade to 1.6.6 - using google-api-java-client

132 views
Skip to first unread message

Koen Maes

unread,
May 29, 2012, 8:11:46 AM5/29/12
to google-a...@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


** cross-posted in google-api-java-client group 

Johan Euphrosine

unread,
May 29, 2012, 10:19:49 AM5/29/12
to google-a...@googlegroups.com
Can you attach the testcase to an issue on the public issue tracker?
http://code.google.com/p/googleappengine/issues/entry?template=Java%20defect

Thanks in advance.
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/8zNuVpniEqcJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.



--
Johan Euphrosine (proppy)
Developer Programs Engineer
Google Developer Relations

Koen Maes

unread,
May 29, 2012, 10:33:44 AM5/29/12
to google-a...@googlegroups.com
I will setup a minimal testcase and keep you posted when it's ready. 
Thx for the follow up.

Koen Maes

unread,
May 29, 2012, 4:47:53 PM5/29/12
to google-a...@googlegroups.com
I got confirmation from another user in the google-api-java-client group. The workaround is to drop UrlFetchTransport and use NetHttpTransport which seems to be supported nowadays on AppEngine.


My app  is working in production now.

Yaniv Inbar

unread,
May 30, 2012, 4:11:06 PM5/30/12
to google-a...@googlegroups.com
Thanks for reporting your findings Koen.

UrlFetchTransport is still supposed to be the recommended choice on Google App Engine.  There is a flaw in Google App Engine implementation of HttpURLConnection in terms of parsing HTTP headers, whereas UrlFetch doesn't have that flaw.  But if NetHttpTransport is working for you, then you may continue to use it.

However, honestly I have not tried it with App Engine 1.6.6.  I have only tried it on 1.6.5.  I'd really like to see an investigation of what causes it to fail on 1.6.6.  Another possibility is that it is not new to 1.6.6, but rather something different about the way you set up your environment.

-- Yaniv

David Hardwick

unread,
May 31, 2012, 6:13:29 PM5/31/12
to Google App Engine
It is not his environment, it happened for us (our posted the solution/
work around on stack overflow), it is related to the latest release.
> >https://groups.google.com/forum/?fromgroups#!topic/google-api-java-cl...

Koen Maes

unread,
May 31, 2012, 6:20:19 PM5/31/12
to google-a...@googlegroups.com
what's the link to your SO question ?
Reply all
Reply to author
Forward
0 new messages