Re: NPE in OAUTH

2014-10-30 Thread Josh Radcliff (AdWords API Team)
Hi Gopi,

Are you using the latest version of the Java client library and its 
dependencies? Specifically, there is a new version of the OAuth library 
that fixes this NPE -- see issue 19 
.

Cheers,
Josh, AdWords API Team

On Tuesday, October 28, 2014 6:37:43 PM UTC-4, Gopi wrote:
>
>
> While migrating to 201409, i am seeing the below exception with OAUTH. I 
> verified the client ID and client secret, they are passed correctly. Is 
> there any thing else i need to verify for this.
>
> Using the Refresh token generatedby GetRefreshToken sample code.
>
> Credential credential = new OfflineCredentials.Builder()
>   .forApi(OfflineCredentials.Api.ADWORDS)
>   .withClientSecrets(clientId, clientSecret)
>   .withRefreshToken(refreshToken)
>   .build()
>   .generateCredential();
>
> java.lang.NullPointerException
> at 
> com.google.api.client.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
> at 
> com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:127)
> at 
> com.google.api.client.json.jackson2.JacksonFactory.createJsonParser(JacksonFactory.java:92)
> at 
> com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:85)
> at 
> com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:81)
> at 
> com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:88)
> at 
> com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
> at 
> com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
> at 
> com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570)
> at 
> com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:362)
> at 
> com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
> at 
> com.google.api.ads.common.lib.auth.OAuth2Helper.callRefreshToken(OAuth2Helper.java:70)
> at 
> com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:144)
>
> Thanks
> Gopi
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0d344e10-0475-48a5-b739-b7935c265a94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


NPE in OAUTH

2014-10-28 Thread Gopi

While migrating to 201409, i am seeing the below exception with OAUTH. I 
verified the client ID and client secret, they are passed correctly. Is 
there any thing else i need to verify for this.

Using the Refresh token generatedby GetRefreshToken sample code.

Credential credential = new OfflineCredentials.Builder()
  .forApi(OfflineCredentials.Api.ADWORDS)
  .withClientSecrets(clientId, clientSecret)
  .withRefreshToken(refreshToken)
  .build()
  .generateCredential();

java.lang.NullPointerException
at 
com.google.api.client.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
at 
com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:127)
at 
com.google.api.client.json.jackson2.JacksonFactory.createJsonParser(JacksonFactory.java:92)
at 
com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:85)
at 
com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:81)
at 
com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:88)
at 
com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
at 
com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
at 
com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570)
at 
com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:362)
at 
com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
at 
com.google.api.ads.common.lib.auth.OAuth2Helper.callRefreshToken(OAuth2Helper.java:70)
at 
com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:144)

Thanks
Gopi

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/58941c8a-2051-4009-bfcd-6579815cdd66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.