UncategorizedMongoDbException: 无法识别的时区标识符

huangapple go评论144阅读模式
英文:

UncategorizedMongoDbException: unrecognized time zone identifier

问题

自从今天开始,在运行测试时我们遇到了一个非常奇怪的错误,我们无法找到错误持续存在的原因。

2020-08-21 15:13:35,035 [ERROR] [] org.mongodb.driver.client: Callback onResult call produced an error
4961
com.mongodb.MongoException: org.springframework.data.mongodb.UncategorizedMongoDbException: 命令失败,错误码为40485(Location40485):'unrecognized time zone identifier: "BST"',位于服务器localhost:27017。完整响应如下:{"ok": 0.0, "errmsg": "unrecognized time zone identifier: \"BST\"", "code": 40485, "codeName": "Location40485"};嵌套异常为com.mongodb.MongoCommandException:命令失败,错误码为40485(Location40485):'unrecognized time zone identifier: "BST"',位于服务器localhost:27017。完整响应如下:{"ok": 0.0, "errmsg": "unrecognized time zone identifier: \"BST\"", "code": 40485, "codeName": "Location40485"}

最重要的是未对失败的测试进行任何代码更改,因此我们猜测根本原因可能在某个全局配置中,但我们难以理解该配置是什么。

非常感谢任何帮助或提示!

英文:

Since today we started to encounter a very strange error during running tests, and we could not find the reason why does the error persist.

2020-08-21 15:13:35,035 [ERROR] [] org.mongodb.driver.client: Callback onResult call produced an error
4961
com.mongodb.MongoException: org.springframework.data.mongodb.UncategorizedMongoDbException: Command failed with error 40485 (Location40485): 'unrecognized time zone identifier: "BST"' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "unrecognized time zone identifier: \"BST\"", "code": 40485, "codeName": "Location40485"}; nested exception is com.mongodb.MongoCommandException: Command failed with error 40485 (Location40485): 'unrecognized time zone identifier: "BST"' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "unrecognized time zone identifier: \"BST\"", "code": 40485, "codeName": "Location40485"}

The most important thing is that no code changes were done to the failed test, so our guess is that the root cause is somewhere in one of the global configurations, but we challenge to understand what is that configuration.

Any help or hint would be highly appreciated.
Thanks!

答案1

得分: 1

问题出在 maven-surefire-plugin 中的 systemPropertyVariablesuser.timozone 上。将它改为 UTC,甚至删除它都可以解决这个问题。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${maven-surefire-plugin.version}</version>
    <configuration>
        <forkCount>1</forkCount>
        <useSystemClassLoader>false</useSystemClassLoader>
        <systemPropertyVariables>
            <user.timezone>UTC</user.timezone>
        </systemPropertyVariables>
    </configuration>
</plugin>
英文:

The issue was with systemPropertyVariables user.timozone in maven-surefire-plugin. Changing it to UTC or even deleting it fixed the issue.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${maven-surefire-plugin.version}</version>
    <configuration>
        <forkCount>1</forkCount>
        <useSystemClassLoader>false</useSystemClassLoader>
        <systemPropertyVariables>
            <user.timezone>BTS</user.timezone>
        </systemPropertyVariables>
    </configuration>
</plugin>

huangapple
  • 本文由 发表于 2020年8月21日 17:44:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/63520429.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定