čtvrtek 21. února 2013

JAXB marshal element without @XmlRootElement anotation

When you are trying marshal MyClass, that is not anotated as @XmlRootElement element, you can obtain:

unable to marshal type "org.company.MyClass" as an element
because it is missing an @XmlRootElement annotation

Possible workaround is marshal your object in this way:

I have found, that more details can be found here:

Žádné komentáře: