Field error in object 'propertyNotice' on field 'release_date': rejected value [Sat Nov 26 2022 08:00:00 GMT+0800 (中国标准时间)]; codes [typeMismatch.propertyNotice.release_date,typeMismatch.release_date,typeMismatch.java.sql.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [propertyNotice.release_date,release_date]; arguments []; default message [release_date]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.sql.Date' for property 'release_date'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.sql.Date] for value 'Sat Nov 26 2022 08:00:00 GMT+0800 (中国标准时间)'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [Sat Nov 26 2022 08:00:00 GMT+0800 (中国标准时间)]]]
Field error in object 'propertyNotice' on field 'release_date': rejected value [Sat Nov 26 2022 08:00:00 GMT+0800 (中国标准时间)]; codes [typeMismatch.propertyNotice.release_date,typeMismatch.release_date,typeMismatch.java.sql.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [propertyNotice.release_date,release_date]; arguments []; default message [release_date]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.sql.Date' for property 'release_date'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.sql.Date] for value 'Sat Nov 26 2022 08:00:00 GMT+0800 (中国标准时间)'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [Sat Nov 26 2022 08:00:00 GMT+0800 (中国标准时间)]]]
Field error in object 'propertyNotice' on field 'release_date': rejected value [Sat Nov 26 2022 08:00:00 GMT+0800 (中国标准时间)];
解决办法:
1.在实体类时间字段上面添加注解@Datetimeformat
2.将mybatis自己生成的包改成java.util.Date;