Java com.microsoft.azure.documentdb.DocumentClientException日期头不';不符合要求的格式
我正在使用sqlapi开发azurecosmosdb。我正在从以下位置使用Azure SDK:Java com.microsoft.azure.documentdb.DocumentClientException日期头不';不符合要求的格式,java,azure,azure-cosmosdb,azure-cosmosdb-sqlapi,azure-java-sdk,Java,Azure,Azure Cosmosdb,Azure Cosmosdb Sqlapi,Azure Java Sdk,我正在使用sqlapi开发azurecosmosdb。我正在从以下位置使用Azure SDK: <dependency> <groupId>com.microsoft.azure</groupId> <artifactId>azure-documentdb</artifactId> <version>2.4.7</version> </dependency> com.mic
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-documentdb</artifactId>
<version>2.4.7</version>
</dependency>
com.microsoft.azure
azure文档数据库
2.4.7
以便将项目插入到集合中
DocumentClient documentClient = setupDocumentClient();
ResourceResponse<Document> document = documentClient.createDocument("/dbs/" + databaseName + "/colls/" + colName, entity, new RequestOptions(), true);
DocumentClient-DocumentClient=setupDocumentClient();
ResourceResponse document=documentClient.createDocument(“/dbs/”+databaseName+“/colls/”+colName,entity,new RequestOptions(),true);
我得到一个例外:
com.microsoft.azure.documentdb.DocumentClientException:消息:
{“Errors”:[“日期头不符合要求的格式。请
确保时间以格林尼治标准时间提供,并符合RFC 1123
日期时间规格。“,”日期标头不符合
所需格式。请确保时间以GMT和
符合RFC 1123日期时间规范。“]}
奇怪的是,我在另一个项目中使用了相同的代码,它在没有异常的情况下工作,数据被正确地插入到Azure Cosmos数据库中。可能有人遇到了此问题并找到了解决方案?我已通过添加以下内容在代码中修复了此问题:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>LATEST</version>
</dependency>
乔达时间
乔达时间
最新的
在此之后,我运行了mvn clean install,异常消失了
显然,我的项目的另一个依赖项是指joda time的旧依赖项