jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
castor
  • castor
  • CASTOR-2222 issue with generated castor mapping f...
  • CASTOR-2227

Exception generated when mapping file is not used.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: 1.2
  • Component/s: XML code generator
  • Labels:
    None
  • Number of attachments :
    1

Description

Hi,

This in continuation to my previous question.

The reason to use mapping file is : Without mapping file , marshalling works but not unmarshalling. While unmarshalling, it searches for the corresponding class for root of the xml. If mapping file is not provided it raises an exception.

The exception raised is on the server side is:

Caused by: org.xml.sax.SAXException: The class for the root element 'EmployeeRequest' could not be found.
at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.
java:1527)
at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.
java:1430)
at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.
java:246)
at org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.
java:183)
at org.exolab.castor.xml.util.DOMEventProducer.start(DOMEventProducer.ja
va:111)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:617)

I am using spring webservices. Initially i have generated classes and class descriptors for the xsd. Next i have marshalled the object and send it to server by using webservicetemplate.

EmployeeResponse response = (EmployeeResponse) webServiceTemplate
.marshalSendAndReceive(employeeRequest);

Whereas in config.xml file the configurations are: (Client side configurations)

<bean id="webServiceTemplate"
class="org.springframework.ws.client.core.WebServiceTemplate">
<property name="messageFactory" ref="messageFactory" />
<property name="defaultUri"
value="http://localhost:8080/empService/" />
<property name="messageSender" ref="urlMessageSender" />

<property name="marshaller" ref="marshaller" />
<property name="unmarshaller" ref="marshaller" />
</bean>

<bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller"/>

Whereas in service -config.xml file the configurations are: (Service side configurations)

<bean id="saveEmpEndpoint"
class="com.hr.ws.SaveEmpEndpoint">
<property name="marshaller" ref="marshaller" />
<property name="unmarshaller" ref="marshaller" />
<property name="saveEmpService" ref="saveEmpService" />
</bean>

<bean id="marshaller"
class="org.springframework.oxm.castor.CastorMarshaller">

</bean>

My SaveEmpEndpoint class extends AbstractMarshallingPayloadEndpoint

I am attaching xsd for your reference.

Thanks in advance.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. XML File
    emp.xsd
    11/Dec/07 5:27 AM
    1 kB
    aparajitha

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity

People

  • Assignee:
    Unassigned
    Reporter:
    aparajitha
Vote (0)
Watch (0)

Dates

  • Created:
    11/Dec/07 5:27 AM
    Updated:
    14/Mar/08 6:41 AM
    Resolved:
    27/Dec/07 4:56 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.