'Exception in thread "main" java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0 when i am using Google Map jar
I am working on Geo Fencing So I am using Google Dependencies "android-maps-utils" and "geopackage-android-map"
I installed these jar in my system and using them in pom.xml file
its working fine in eclipse IDE but when i built the project and run project jar separately, that time it's throwing Expecetion given below :
Thanks in advance for helping.
Exception in thread "main" java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
at java.time.temporal.ValueRange.checkValidValue(Unknown Source)
at java.time.temporal.ChronoField.checkValidValue(Unknown Source)
at java.time.LocalDate.of(Unknown Source)
at java.time.LocalDateTime.of(Unknown Source)
at org.springframework.boot.loader.jar.CentralDirectoryFileHeader.decodeMsDosFormatDateTime(CentralDirectoryFileHeader.java:127)
at org.springframework.boot.loader.jar.CentralDirectoryFileHeader.getTime(CentralDirectoryFileHeader.java:116)
at org.springframework.boot.loader.jar.JarEntry.<init>(JarEntry.java:58)
at org.springframework.boot.loader.jar.JarFileEntries.getEntry(JarFileEntries.java:316)
at org.springframework.boot.loader.jar.JarFileEntries.access$400(JarFileEntries.java:48)
at org.springframework.boot.loader.jar.JarFileEntries$EntryIterator.next(JarFileEntries.java:366)
at org.springframework.boot.loader.jar.JarFileEntries$EntryIterator.next(JarFileEntries.java:350)
at org.springframework.boot.loader.jar.JarFile$2.nextElement(JarFile.java:204)
at org.springframework.boot.loader.jar.JarFile$2.nextElement(JarFile.java:195)
at org.springframework.boot.loader.archive.JarFileArchive$EntryIterator.next(JarFileArchive.java:189)
at org.springframework.boot.loader.archive.JarFileArchive$EntryIterator.next(JarFileArchive.java:174)
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:85)
at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Solution 1:[1]
This Api takes mont number in format 1-12. You need add one +1
when you are going from place that uses 0-11 for counting months.
Solution 2:[2]
Looks like it was fixed in spring-boot 2.1.12 https://github.com/spring-projects/spring-boot/pull/19595
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | rgolcz |