Q:

JAXB how to handle inheritance

I followed the tutorial by Blaise, where he explains how to output xml from objects where one inherit from the other.
I can however not get this to work the other way around. I have two objects (Actually its a far more complicated model). In essence, one inherit from the other, but when I provide it with the xml, it tries to create an instance of the base class. It can't since its an abstract class.
Does anyone have an example of how I can do this? 

A:

You need to ensure that the JAXBContext is aware of the subclass.  This can be done by passing in the subclass when creating the JAXBContext or by using the @XmlSeeAlso annotation on the super class to point to all the mapped subclasses.

