This exception is thrown when Dozer, a Java Bean mapping library, encounters a class that contains a property of type 'java.time.LocalDateTime' but cannot find a default constructor for that class.

The 'NoSuchMethodException' indicates that there is no constructor with no arguments (i.e. a default constructor) in the 'LocalDateTime' class, which is required for Dozer to instantiate the object during the mapping process.

To resolve this issue, you can either provide a default constructor in the 'LocalDateTime' class or use a different mapping library that supports mapping of Java 8 date/time types. Alternatively, you can also use a custom converter in Dozer to map the 'LocalDateTime' property to a different type that can be instantiated without a default constructor.

Dozer MappingException: java.lang.NoSuchMethodException for java.time.LocalDateTime

原文地址: https://www.cveoy.top/t/topic/oLUr 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录