Details
Description
I am trying to validate service layer method arguments using the MethodValidationPostProcessor. This is failing on, what appears to be, different the method signatures.
With an interface such as:
@Validated public interface Service<T> { public T create(@Valid T item); public T update(String identifier, @Valid T item); }
And the following implementation:
@Named public class ItemService implements Service<Item>{ @Override public Item create(Item item) { return item; } @Override public Item update(String identifier, Item item) { return item; } }
Validation works fine when calling update(String, Item) but throws the following exception when calling create(Item):
java.lang.IllegalArgumentException: HV000162: The validated type org.commons.test.validation.ItemService does not specify the constructor/method: public abstract java.lang.Object org.commons.test.validation.Service.create(java.lang.Object)
This is also working fine if Service<T> is an abstract class and I just extend it.
Attached is a sample application that demonstrates the problem.