You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2015/06/01 19:42:32 UTC

Re: NumberFormatException with OAuthClientUtils and Google APIs

Hi Jaime

Good to hear from you,
I recall fixing this issue not that long ago (I'm working on a big_query 
demo in the distribution), what CXF version are you working with ? Try 
CXF 2.7.15 or 3.0.5 ?

Cheers, Sergey
On 28/05/15 17:39, jmeritt wrote:
> I'm seeing a numberformatexception thrown from OAuthClientUtils when it is
> trying to parse the expiration time for an access token generated by Google.
> Apparently it adds a leading space to the expiration time which causes the
> parse to fail.  Any workarounds or should I just log a JIRA?
>
> Thanks,
> Jaime
>
> Exception in thread "main" java.lang.NumberFormatException: For input
> string: " 3600"
> 	at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> 	at java.lang.Long.parseLong(Long.java:578)
> 	at java.lang.Long.valueOf(Long.java:803)
> 	at
> org.apache.cxf.rs.security.oauth2.client.OAuthClientUtils.fromMapToClientToken(OAuthClientUtils.java:308)
> 	at
> org.apache.cxf.rs.security.oauth2.client.OAuthClientUtils.getAccessToken(OAuthClientUtils.java:270)
> 	at
> org.apache.cxf.rs.security.oauth2.client.OAuthClientUtils.getAccessToken(OAuthClientUtils.java:208)
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/NumberFormatException-with-OAuthClientUtils-and-Google-APIs-tp5757776.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>