title: Could not read JSON: Current token (VALUE_STRING) not numeric, can not use numeric value accessors
body: <p>I was trying to get the getAccessToken with spring rest template as given below. I am getting the below error, while calling oAuthRestTemplate.getAccessToken()</p>
  
  <pre><code>Exception in thread "main" org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Current token (VALUE_STRING) not numeric, can not use numeric value accessors
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>ResourceOwnerPasswordResourceDetails resource = new ResourceOwnerPasswordResourceDetails();
  
  resource.setAccessTokenUri("https://../oauth2/token");
  resource.setUsername("u");
  resource.setPassword("p");
  resource.setClientSecret("...s");
  resource.setClientId("...i");
  resource.setGrantType("password");
  List&lt;String&gt; scopes = new ArrayList&lt;String&gt;(2);
  scopes.add("write");
  scopes.add("read");
  resource.setScope(scopes);
  
  
  DefaultOAuth2ClientContext clientContext = new DefaultOAuth2ClientContext();
  
  List&lt;HttpMessageConverter&lt;?&gt;&gt; messageConverters = new ArrayList&lt;HttpMessageConverter&lt;?&gt;&gt;();
  messageConverters.add(new MappingJackson2HttpMessageConverter());  
  messageConverters.add(new FormHttpMessageConverter());
  OAuth2RestTemplate oAuthRestTemplate =  new OAuth2RestTemplate(resource,clientContext);
  oAuthRestTemplate.setMessageConverters(messageConverters);
  
  try {
      SSLUtil.turnOffSslChecking();
      System.out.println(oAuthRestTemplate.getAccessToken());
      String result = oAuthRestTemplate.getForObject("url" + "/api/version", String.class);
  } catch (RestClientException e) {
      e.printStackTrace();
  }   
  </code></pre>
  
  <p>Full Errortrace:</p>
  
  <pre><code>Exception in thread "main" org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Current token (VALUE_STRING) not numeric, can not use numeric value accessors
   at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@44908881; line: 1, column: 159]; nested exception is com.fasterxml.jackson.core.JsonParseException: Current token (VALUE_STRING) not numeric, can not use numeric value accessors
   at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@44908881; line: 1, column: 159]
      at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.readJavaType(MappingJackson2HttpMessageConverter.java:171)
      at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.read(MappingJackson2HttpMessageConverter.java:163)
      at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:94)
      at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:491)
      at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:454)
      at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:113)
      at org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider.obtainAccessToken(ResourceOwnerPasswordAccessTokenProvider.java:47)
      at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainNewAccessTokenInternal(AccessTokenProviderChain.java:142)
      at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainAccessToken(AccessTokenProviderChain.java:118)
      at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:216)
      at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:168)
      at com.ClientTemplate.main(ClientTemplate.java:69)
  Caused by: com.fasterxml.jackson.core.JsonParseException: Current token (VALUE_STRING) not numeric, can not use numeric value accessors
   at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@44908881; line: 1, column: 159]
      at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1419)
      at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:508)
      at com.fasterxml.jackson.core.base.ParserBase._parseNumericValue(ParserBase.java:748)
      at com.fasterxml.jackson.core.base.ParserBase.getLongValue(ParserBase.java:619)
      at org.springframework.security.oauth2.common.OAuth2AccessTokenJackson2Deserializer.deserialize(OAuth2AccessTokenJackson2Deserializer.java:75)
      at org.springframework.security.oauth2.common.OAuth2AccessTokenJackson2Deserializer.deserialize(OAuth2AccessTokenJackson2Deserializer.java:44)
      at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051)
      at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2206)
      at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.readJavaType(MappingJackson2HttpMessageConverter.java:168)
      ... 11 more
  </code></pre>
  
  <p>Tried without messageConverters.Still the same error.</p>