2024-03-03 11:15:42,784 [XNIO-1 task-1] ERROR [com.sdyb.common.exception.GlobalExceptionHandler] GlobalExceptionHandler.java:90 - 服务器异常org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestParam java.time.LocalDate] for value '3/3/24'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [3/3/24]

2024-03-03by@794842744-UcEbn&@GPT-4.Model: gpt-4
794842744-UcEbn

2024-03-03 11:15:42,784 [XNIO-1 task-1] ERROR [com.sdyb.common.exception.GlobalExceptionHandler] GlobalExceptionHandler.java:90 - 服务器异常org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestParam java.time.LocalDate] for value '3/3/24'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [3/3/24]

Avatar
Avatar

The error you're seeing is related to a type mismatch when attempting to convert a String to a LocalDate in a Spring application. The MethodArgumentTypeMismatchException