Announcement Announcement Module
No announcement yet.
JAXB and Spring integration error Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JAXB and Spring integration error


    I am using Spring 2.5.5 and Spring-WS 1.5.4.
    I am trying to use the JAXB functionnality to unmarshall XML and to marshall objects.
    My application-context.xml file is as follow :

    <bean id="xmlMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="contextPath" value="com.alu.mpv3.enricher.domain.jaxbgen" />
    <property name="schema" value="classpath:xsd/request.xsd" />

    and when I initialize the Spring context I have the following error :

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'xmlMarshaller' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:;

    If I remove the line relative to the property "schema" the error disappears.
    I tried to replace the value="classpath..." with a reference to another bean
    such as :
    <bean id="xsd" class=" ce">
    <constructor-arg value="xsd/request.xsd" />

    but the error still remains.

    I really don't know why and I can't find a solution. Does anyone can help me please ?
    Many thanks.


  • #2
    You do not have to set the schema for jaxb2Marshaller unless you want to validate the schema. Well if you want to set schema make sure the file can be loaded as a Resource.