Announcement Announcement Module
Collapse
No announcement yet.
Unmarhaller to use ObjectFactory? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unmarhaller to use ObjectFactory?

    How can I have the unmarshaller create objects using the generated ObjectFactory? I tried setting "com.sun.xml.bind.ObjectFactory" in the jaxbContextProperties of Jaxb2Marshaller, but get the exception "property 'com.sun.xml.bind.ObjectFactory' is not supported;"

  • #2
    Ok, I found the solution. The property needs to be configured via unmarshallerProperties:

    Code:
        <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
        	<property name="classesToBeBound">
                ...
        	</property>
            <property name="unmarshallerProperties">
            	<map>
            		<entry key="com.sun.xml.bind.ObjectFactory">
            			<bean class="myObjectFactory"/>
            		</entry>
            	</map>
            </property>
        </bean>

    Comment

    Working...
    X