I did some homework and realized that the problem comes from JAXB.
The problematic item is "invention-title" as described below. It uses mixed
content. From the definition of the XmlMixedContent class, it becomes clear why
java.lang.String appears in the JAXB DOM Tree and cannot be digested by HIBERNATE.
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:attribute name="id" type="xs:ID"/>
The XML fragment which causes the problem is the following:
<invention-title id="d0e53">Ice confection</invention-title>
That appear pretty trivial but apparently needs some tricks to get around – if
possible at all.
The following is from the JAXB documentation
Annotation Type XmlMixed
public @interface XmlMixed
Annotate a JavaBean multi-valued property to support mixed content.
The usage is subject to the following constraints:
- can be used with @XmlElementRef, @XmlElementRefs or @XmlAnyElement
The following can be inserted into @XmlMixed annotated multi-valued property
- XML text information items are added as values of java.lang.String.
- Children element information items are added as instances of JAXBElement
or instances with a class that is annotated with @XmlRootElement.
- Unknown content that is not be bound to a JAXB mapped class is inserted as
Element. (Assumes property annotated with @XmlAnyElement)