Unable to marshall - missing an @XmlRootElement annotation
When trying to marshall an object I get this error message:
unable to marshal type "org.blah.MessageType" as an element because it is missing an @XmlRootElement annotation
If I add the @XmlRootElement annotation to the MessageType, it works, but my question is why doesn't the JAXB compiler put this annotation in automatically. It's inconvenient because MessageType is automatically generated and I don't want to edit it every time I regenerate the java classes.
Is there any better way to resolve this problem?