Announcement Announcement Module
Collapse
No announcement yet.
Jaxb2Marshaller creates JAXBContext with empty namespace URI Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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">
    <list>
    <value>com.mydomain.xml.schema.Products</value>
    </list>
    </property>
    <property name="marshallerProperties">
    <map>
    <entry key="com.sun.xml.bind.namespacePrefixMapper">
    <bean class="com.mydomain.xml.MyNamespacePrefixMapper"/>
    </entry>
    </map>
    </property>
    </bean>

    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?
Working...
X