修正谷歌api java的纬度任何人的样本?

修正谷歌api java的纬度任何人的样本?,java,google-api,Java,Google Api,我刚刚检查了GoogleAPI java客户端示例,并使用EclipseMaven构建了它们 我使用使用者密钥、使用者机密和输入密钥自定义了我的ClientCredentials类 当我运行该示例时,它会要求我获得访问我的google latitude数据的授权,并关闭浏览器,eclipse控制台会出现以下错误: 2011-05-21 23:57:01.777:INFO::Logging to STDERR via org.mortbay.log.StdErrLog 2011-05-21 23:

我刚刚检查了GoogleAPI java客户端示例,并使用EclipseMaven构建了它们

我使用使用者密钥、使用者机密和输入密钥自定义了我的
ClientCredentials

当我运行该示例时,它会要求我获得访问我的google latitude数据的授权,并关闭浏览器,eclipse控制台会出现以下错误:

2011-05-21 23:57:01.777:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2011-05-21 23:57:01.778:INFO::jetty-6.1.24
2011-05-21 23:57:01.792:INFO::Started SocketConnector@localhost:51514
Created new window in existing browser session.
2011-05-21 23:57:09.121:INFO::Stopped SocketConnector@localhost:51514
Current location:
java.lang.IllegalArgumentException
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:72)
    at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:450)
    at com.google.api.client.json.JsonParser.parse(JsonParser.java:249)
    at com.google.api.client.json.JsonParser.parseAndClose(JsonParser.java:176)
    at com.google.api.client.json.JsonParser.parseAndClose(JsonParser.java:115)
    at com.google.api.client.googleapis.json.JsonCParser.parse(JsonCParser.java:49)
    at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:261)
    at com.google.api.client.sample.latitude.model.LocationResource.executeGetCurrentLocation(LocationResource.java:78)
    at com.google.api.client.sample.latitude.LatitudeSample.showCurrentLocation(LatitudeSample.java:50)
    at com.google.api.client.sample.latitude.LatitudeSample.main(LatitudeSample.java:34)
调试应用程序时,这些变量位于JsonParser.class的第450行:

newInstance null    
isMap   false   
token   JsonToken  (id=40)  
name    "VALUE_STRING" (id=55)  
ordinal 5   
field   Field  (id=45)  
fieldClass  Class<T> (java.lang.Long) (id=47)   
以下是HG总结:

bob@computer:~/development/google-api-java-client-samples$ hg summary
parent: 92:4be51d2cc385 tip
 Samples for version 1.4.
branch: default
commit: 1 modified
update: (current)
更新 这可以通过将com.google.api.client.sample.latitude.model.LocationResource第30行从“public Long timestampMs;”更改为“public String timestampMs;”来解决。因为服务器发回的是字符串而不是数字

真正的问题是:当样本需要一个数字时,为什么服务器会发回一个字符串?示例代码是否错误?(可能)还是服务器

bob@computer:~/development/google-api-java-client-samples$ hg summary
parent: 92:4be51d2cc385 tip
 Samples for version 1.4.
branch: default
commit: 1 modified
update: (current)