Announcement Announcement Module
No announcement yet.
Spring Webservice with Jaxb Marshalling Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Webservice with Jaxb Marshalling

    I am new to spring web services and currently trying to develop a contract first web service using spring ws 1.5.6. I want to use jaxb 2.0 marshaller to do all manipulation in form of java objects. But currently i am getting an exception in unmarshaling of incoming request. i have been fighting with it for last 2 days. Please help me in resolving this issue.

    Here is the log of the error. From the log you can see that end point is correctly mapped to incoming request but when it tries to unmarshal incoming object it gives the following exception.

    19:17:50,264DEBUG PayloadRootAnnotationMethodEndpointMapping:61 - Looking up endpoint for [{}HolidayRequest]
    19:17:50,269DEBUG SoapMessageDispatcher:251 - Endpoint mapping [ loadRootAnnotationMethodEndpointMapping@162ba99] maps request to endpoint [public void essRegistrationRequest( idayRequest)]
    19:17:50,274DEBUG SoapMessageDispatcher:273 - Testing endpoint adapter [ ericMarshallingMethodEndpointAdapter@89c116]
    19:17:50,339DEBUG MessageDispatcherServlet:588 - Could not complete request
    java.lang.NoSuchMethodError: com.sun.xml.bind.unmarshaller.DOMScanner.setConten tHandler(Lorg/xml/sax/ContentHandlerV
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal0(
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal(
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.un marshal(
    at org.springframework.oxm.jaxb.Jaxb2Marshaller.unmar shal(
    at marshal(
    at shallingMethodEndpointAdapter.unmarshalRequest(Mar
    at shallingMethodEndpointAdapter.invokeInternal(Marsh
    at tractMethodEndpointAdapter.invoke(AbstractMethodEn
    at spatch(
    at ceive(
    at eMessageReceiverObjectSupport.handleConnection(Web
    at ssageReceiverHandlerAdapter.handle(WebServiceMessa
    at tcherServlet.doService(MessageDispatcherServlet.ja va:230)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
    at org.springframework.web.servlet.FrameworkServlet.d oPost(
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)

    <bean id="congressRegistrationEndpoint" class="">
    <constructor-arg ref="hrService"/>

    <bean class=" ter.GenericMarshallingMethodEndpointAdapter">
    <constructor-arg ref="marshaller"/>

    <bean class=" ing.PayloadRootAnnotationMethodEndpointMapping"/>

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="contextPath" value=""/>

    <bean id="hrService" class=" ervice"/>
    Annotation End point:

    public class AnnotationEndpoint {
    	private HumanResourceService humanResourceService;
    	public AnnotationEndpoint(HumanResourceService humanResourceService) {
    		this.humanResourceService = humanResourceService;
    	@PayloadRoot(localPart = "HolidayRequest", namespace = "")
    	public void handleCongressRegistrationRequest(HolidayRequest holidayRequest) {
    Please see if i am doing anything wrong.

    Last edited by mmuzamil; Apr 21st, 2009, 09:40 AM.

  • #2
    Hi all,

    i have fixed this issue, at the end it turned out to be conflict between different versions (1 and 2.1) of jaxb api. I have removed jar files of jaxb V1 from my project and web service is now up and running.