fer626 / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Can no longer create UrlFetchTransport since GAE SDK 1.6.6 #499

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.5.0-beta)?
1.8.0 and 1.9.0-beta, both for AppEngine

Java environment (e.g. Java 6, Android 2.3, App Engine)?
Linux n53sv 3.2.0-24-generic #38-Ubuntu SMP Tue May 1 16:18:50 UTC 2012 x86_64 
x86_64 x86_64 GNU/Linux java version "1.6.0_31" Java(TM) SE Runtime Environment 
(build 1.6.0_31-b04) Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed 
mode)

The problem started after upgrading to GAE SDK 1.6.6; it worked when using GAE 
SDK 1.6.5

Describe the problem.

I had code working perfectly under GAE SDK 1.6.5; Then after upgrading to 
1.6.6, I cannot no longer create an instance of the following stripped-down 
class in my development server :

When I try to create an instance of the following class

public class BadClassTest {

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

    public BadClassTest() {
    }

}
I run into this error :

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

I have tried with both google-api-java-client 1.8.0 and 1.9.0-beta. 
The weird thing is, when you do not keep a pointer to this HttpTransport, then 
the verify error is not there :

public class BadClassTest {

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

}

for reference also :

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

How would you expect it to be fixed?

I want the verify error to disappear, that would be a great fix ;)
I opened this bug 
http://code.google.com/p/googleappengine/issues/detail?id=7593 with Appengine 
team, because either one of you has a problem; Or it is my installation ?

Original issue reported on code.google.com by k...@koma.be on 28 May 2012 at 10:04

GoogleCodeExporter commented 9 years ago
see 
https://groups.google.com/forum/?fromgroups#!topic/google-api-java-client/FJSsz5
qo7pg

confirmed the problem
Switching to NetHttpTransport is the workaround.

Original comment by k...@koma.be on 30 May 2012 at 7:49

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 1 Jun 2012 at 12:22

GoogleCodeExporter commented 9 years ago
Leaving this issue open for tracking.

Posted by Yaniv Inbar in 
http://stackoverflow.com/questions/10764671/verifyerror-after-upgrading-to-appen
gine-1-6-6-cannot-create-instance-of-urlfet :

We figured out the problem: 
com.google.api.client.extensions.appengine.http.urlfetch.UrlFetchTransport is 
included in the App Engine SDK in appengine-local-webapis.jar . This class is 
actually there by mistake, and in fact the whole jar is unnecessary. Our 
primary recommendation as a work-around is to simply delete this jar from your 
App Engine SDK installation. It is only loaded in the local development server, 
and not in the production App Engine. I have not tried this myself yet, but 
another engineer assures me that it should work. Please try it and let me know.

If that work-around that does not work, you may try downgrading to App Engine 
SDK 1.6.5. The appengine-local-webapis.jar is new to 1.6.6, and again this is 
only an issue for local development.

Finally, if that doesn't work for you, switch to NetHttpTransport as 
recommended by koma. There is a bug in App Engine HttpURLConnection 
implementation (upon which NetHttpTransport is built) in that it splits up HTTP 
response headers by any commas. UrlFetchTransport doesn't have this problem. 
However, this is unlikely to affect most developers, unless for example you are 
handling redirects and the redirect URL has a comma in it. It should not be an 
issue with any Google API except the old Calendar Data API version 2 (not for 
the new version 3).

I am working with the App Engine team right now to make sure this will be fixed 
in the next release. Sorry about that!

Original comment by rmis...@google.com on 4 Jun 2012 at 11:05

GoogleCodeExporter commented 9 years ago
Marking as Won't Fix only because we expect the next App Engine SDK release to 
fix it for us.

Original comment by yan...@google.com on 4 Jun 2012 at 11:16

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 4 Jun 2012 at 11:16

GoogleCodeExporter commented 9 years ago
Instead of waiting for App Engine SDK release, we will fix this in the library 
ASAP.  Moved to:
http://code.google.com/p/google-http-java-client/issues/detail?id=125

Original comment by yan...@google.com on 6 Jun 2012 at 5:27