users@jaxb.java.net

How to serialize an Exception subclass in JAXB

From: D'Arcy, Hamlet B <Hamlet.DArcy_at_Pearson.com>
Date: Thu, 6 Aug 2009 16:17:55 -0500

How do you serialize a subclass of Exception?

Here is my exception:

        @XmlType
        public static class ValidationFault extends Exception {
                public ValidationFault() {

                }
        }

I have tried all sorts of variations on using @XmlTransient and
@XmlAccessorType, but JAXB continually tries to serialize the
getStackTrace/setStackTrace pair, which can't be done.

How do I tell JAXB to ignore all the fields on the parent?

--
Hamlet D'Arcy