At present my application running on spring version 2.4.1 and its supporting my application PST Time Zone. Which is running successfully since long time. Now I have upgraded my application spring version to 2.4.8. & its not supporting my application existing PST Time Zone. I think this is Bug in spring version 2.4.8.
Comment From: snicoll
Please note this is the issue tracker for the Spring Framework, not Spring Boot. I am afraid there's nothing that comes to mind with regard of a specific time zone. If you want support, please take the time to share a small sample that we can run that shows it works with 2.4.1 and doesn't with 2.4.8. You can do so by attaching a zip to this issue or sharing a link to a GitHub repository.
Comment From: iamsunilds-github
please find below demo project URL ( https://github.com/sunilds-repo/demo- ), so you can run application in you machine with connecting local mysql database. and in POM.XML you can upgrade the spring version from 2.4.1 to 2.4.8. and you will see the issue.
Comment From: snicoll
Thanks for the sample. As I was suspecting this has nothing to do with Spring. Upgrading to Spring Boot 2.4.8
also upgrades the mysql driver from 8.0.22
to 8.0.25
, which leads to:
Caused by: java.time.zone.ZoneRulesException: Unknown time-zone ID: PST
at java.base/java.time.zone.ZoneRulesProvider.getProvider(ZoneRulesProvider.java:279) ~[na:na]
at java.base/java.time.zone.ZoneRulesProvider.getRules(ZoneRulesProvider.java:234) ~[na:na]
at java.base/java.time.ZoneRegion.ofId(ZoneRegion.java:120) ~[na:na]
at java.base/java.time.ZoneId.of(ZoneId.java:408) ~[na:na]
at java.base/java.time.ZoneId.of(ZoneId.java:356) ~[na:na]
at com.mysql.cj.protocol.a.NativeProtocol.configureTimeZone(NativeProtocol.java:2191) ~[mysql-connector-java-8.0.25.jar:8.0.25]
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2218) ~[mysql-connector-java-8.0.25.jar:8.0.25]
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1315) ~[mysql-connector-java-8.0.25.jar:8.0.25]
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:964) ~[mysql-connector-java-8.0.25.jar:8.0.25]
... 56 common frames omitted
The stacktrace has no presence of Spring-related classes, and overridding the version of the driver to 8.0.22
for testing purposes with 2.4.8
works. Going forward, please review dependency upgrade in third parties before raising an issue here.
I believe this SO thread could be useful. Changing your configuration to use jdbc:mysql://localhost:3306/test_database?serverTimezone=America/Los_Angeles
worked for me.