Announcement Announcement Module
Collapse
No announcement yet.
Jaxb2Marshaller not invoking the ValidationEventHandler Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jaxb2Marshaller not invoking the ValidationEventHandler

    Hi,

    The following is the configuration for jaxb2marshaller:

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="contextPath" value="${jaxb2Marshaller.contextPath}" />
    <property name="validationEventHandler" ref="validationEventHandler" />
    <property name="schemas" ref="schemaList" />
    <property name="schemaLanguage" value="http://www.w3.org/2001/XMLSchema" />
    </bean>
    <!-- schema list -->
    <util:list id="schemaList">
    <value>classpath:subscription/service-contracts/subscriptionService-1.0.xsd</value>
    </util:list>
    <!-- extends ValidationEventHandler from JAXB -->
    <bean id="validationEventHandler" class="com.my.org.client.CustomValidationEventHand ler" />

    This configuration does not invoke the validation handler at all while unmarshalling. I receive an Exception in the following code:
    //-----
    String failureMessageString = "<...valid...message.../>";
    jaxb2Marshaller.unmarshal(new StringSource(failureMessageString));
    //-----

    Any ideas what I am doing wrong?

    Thanks in advance.
Working...
X