Announcement Announcement Module
Collapse
No announcement yet.
Custom JAXB adapter not working with Spring JAXB2Marshaller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom JAXB adapter not working with Spring JAXB2Marshaller

    I am trying to add custom JAXB adapter for date formatting.
    The <oxm:jaxb2-marshaller../> tag does not have option to add adapters.

    I checked the Javadoc of org.springframework.oxm.jaxb.Jaxb2Marshaller and found property adapters. So I decided to create a bean using regular <bean> tag instead of <oxm:jaxb2-marshaller../> configuration. And I added the adapter in the property of this bean.

    <bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="contextPath" value="...." />
    <property name="adapters">
    <list>
    <bean class=".....DateTimeConverterAdapter" />
    </list>
    </property>
    </bean>

    This adapter never gets called.

    Same adapter class works if I configure it in package-info.java in the JAXB generated Java beans.

    Am I missing something? Thanks in advance.
Working...
X