Results 1 to 2 of 2

Thread: Unmarhaller to use ObjectFactory?

  1. #1
    Join Date
    Aug 2004
    Posts
    230

    Default 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;"
    Barry Kaplan (memelet)

  2. #2
    Join Date
    Aug 2004
    Posts
    230

    Default

    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>
    Barry Kaplan (memelet)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •