title: JAXB - Map Java interface to 3rd-party library implementation in a Web service context
body: <p>I try to expose the following method as a web service<br>
  <code>public void validate(Foo foo) throws javax.validation.ConstraintViolationException;</code>  </p>
  
  <p>The problem is <code>ConstraintViolationException</code> embeds a <code>Set</code> of <code>javax.validation.ConstraintViolation</code> which is an interface. I use <code>hibernate-validator</code> as javax.validation API implementation.</p>
  
  <p>As is, JAXB can't handle interface. I'm stuck on mapping <code>org.hibernate.validator.engine.ConstraintViolationImpl</code> to <code>ConstraintViolation</code> at runtime.</p>
  
  <p>Obviously, the only code I can change is my Web service.</p>
  
  <p>How can I defined, in this context, the set of implementation I want to use for all the interface I have?</p>
  
  <p>Thanks </p>