I want to throw a custom exception from a CXF service. 

The exception class has a List<Failure> field in it. Failure is a
properly JAXB annotated class. 

Here is one way to write this exception: 

  public class ValidationException extends RuntimeException {
    private List<Failure> failures; 

    ... Getters/setters omitted
  }


I can't get this custom exception to serialize properly. 

I tried subclassing SoapFault and adding fields, but the list was never
serialized. 

I tried subclassing RuntimeException and annotating the custom fields,
but getStackTrace/setStackTrace on the parent class can't be serialized.


How can I throw an exception from a CXF service that has a List<Failure>
field? 

--
Hamlet D'Arcy
[email protected]
+1(952)681-3636 

Reply via email to