Dozer 自定义Converter -- LocalDateTime to Date
Spring boot项目,使用dozer将Jpa Entity中的LocalDateTime属性转到DTO中对应的LocalDateTime属性中报错 java.lang.NoSuchMethodException: java.time.LocalDateTime.<init>() at java.lang.Class.getConstructor0(Class.java:3082) ~[na:1.8.0_51] at java.lang.Class.getDeclaredConstructor(Class.java:2178) ~[na:1.8.0_51] at org.dozer.factory.ConstructionStrategies$ByConstructor.newInstance(ConstructionStrategies.java:272) ~[dozer-5.5.1.jar:na] 将DTO中的LocalDateTime换成Date又报错 java.lang.NumberFormatException: For input string: "2015-10-17T17:55:12.091" 解决方法: 添加一个自定义Convert public class LocalDateTimeToDateDozerConverter extends