JAXB generating JAXBElement<String> instead of String

What I had to do is to wrap jaxb:globalBindings with another jaxb:bindings.

<jaxb:bindings version="2.0"
               xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
    <jaxb:bindings>
        <jaxb:globalBindings generateElementProperty="false"/>
    </jaxb:bindings>
</jaxb:bindings>

Now everything is working, there is no JAXBElement<String> generated anymore.


You can't have nillable and minoccurs together. Remove the minoccurs as it doesn't make sense for strings anyway.


I think you want to add in your jaxb-binding.xml:

<jaxb:bindings ... xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
    <jaxb:globalBindings generateElementProperty="false">
        <xjc:simple />
        <!-- ... -->
    </jaxb:globalBindings>
</jaxb:bindings>