Search code examples
javaspringmavenspring-bootdozer

Dozer org.dozer.MappingException


Dozer gives me this error:

llegal object type for the method 'setEstado'. 
 Expected types: 
es.dominion.alert.util.dtos.TbEstadoDto
 Actual types: 
es.dominion.alert.util.dtos.TbEstadoDto

I've the Dozer configuration with Spring Boot:

 @Bean
public Mapper mapper() {
    return new DozerBeanMapper(Arrays.asList("dozerMapping.xml"));
}

And in @Service I inject the mapper with @Autowired. I use Hibernate and Spring-JPA to fetch de data and this object is EAGER mapped.

I've no idea how to solve the situation.It could be maven filtering? I'm using profiles.


Solution

  • It was Spring-Boot-Devtools. The auto loader used by DevTools isn’t including Dozer classes. I fixed it adding this:

    restart.include.dozer=/dozer-5.5.1.jar