Announcement Announcement Module
No announcement yet.
Jaxb2Marshaller creates JAXBContext with empty namespace URI Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jaxb2Marshaller creates JAXBContext with empty namespace URI

    Hope this is in the right place. Using Spring 3, I have created a MarshallingView, with the following marshaller:

    <bean name="xmlMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="classesToBeBound">
    <property name="marshallerProperties">
    <entry key="com.sun.xml.bind.namespacePrefixMapper">
    <bean class="com.mydomain.xml.MyNamespacePrefixMapper"/>

    The MyNamespacePrefixMapper is supposed to map the schema of the Products object (XJC generated) to the default namespace, but it doesn't because the Jaxb2Marshaller is creating a JAXBContext that contains two different namespace URIs. One is my schema, the other one is a blank string. The blank string overrides any attempt by me to assign a default namespace.

    Anyone know why this blank string is there or how I can get rid of it?