I established a Spring Boot project with jersey starter and log4j2 starter as well as added a resource class as below:
@Controller
@Path("test")
public class TestResource {
@POST
public String hello(@Valid Message message) {
return message.getMsg();
}
}
When I visit the action, the following exception would be thrown.
java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface javax.validation.Valid: @javax.validation.Valid()
But if I remove log4j2 starter dependency from pom.xml, there will be no such weird problem.
Does anyone know what happened to the situation?