views:

7

answers:

0

Hi All

My input xml has some extra tags which I donot need,like this

<College>
   <Address>
     Address of the college
    </Address>
   <Name>
      xyz
   </Name>
</College>

In this I dont need Address details.I just need 'Name' alone.So I have just mapped Name alone as below:

<?xml version="1.0" encoding="UTF-8"?>
<mapping>
    <class name="College">
        <map-to xml="College" />
        <field name="name" type="string">
   <bind-xml name="Name" />
        </field>
    </class>
</mapping>

And java class for this is

public class College{
 private String name;
  public void setName(String name){
   this.name = name;
   }

  public String getName(){
    return name;   
    }
}

I am getting the following error: Caused by: org.xml.sax.SAXException: unable to find FieldDescriptor for 'Address' in ClassDescriptor of 'College' at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1925) at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1353) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709) at com.tcs.tsp.util.castor.XMLHandler.getObjectFromXMLStringWithTrimmedValues(XMLHandler.java:248) at com.tcs.tsp.deviceregistry.services.adclocationvalidation.ADCLocationValidationService.validateADCFullLocation(ADCLocationValidationService.java:26) at com.tcs.tsp.services.printing.ADCLocationValidationService.ADCLocationValidation.doService(ADCLocationValidation.java:79) at com.sonicsw.esb.service.common.impl.AbstractSFCServiceImpl.service(Unknown Source) at com.sonicsw.xqimpl.service.debug.DebugServiceInterceptor.intercept(DebugServiceInterceptor.java:118) at com.sonicsw.xqimpl.service.XQServiceChain$XQInterceptorServiceWrapper.intercept(XQServiceChain.java:481) at com.sonicsw.xqimpl.service.XQServiceChain$XQInterceptorServiceWrapper.service(XQServiceChain.java:470) at com.sonicsw.xqimpl.service.XQServiceChain.service(XQServiceChain.java:151) at com.sonicsw.xqimpl.service.ServiceMessageHandler.callService(ServiceMessageHandler.java:429) at com.sonicsw.xqimpl.service.ServiceMessageHandler.handleMessage(ServiceMessageHandler.java:190) at com.sonicsw.xqimpl.service.ProcessMessageHandler.doHandleMessage(ProcessMessageHandler.java:317) at com.sonicsw.xqimpl.service.ProcessMessageHandler.handleMessage(ProcessMessageHandler.java:94) at com.sonicsw.xqimpl.service.XQDispatcher.onMessage(XQDispatcher.java:422) at com.sonicsw.xqimpl.endpoint.container.EndpointContextContainer.onMessage(EndpointContextContainer.java:90) at com.sonicsw.xq.connector.jms.JMSEndpoint$JMSEndpointListener.onMessage(JMSEndpoint.java:575) at progress.message.jimpl.Session.deliver(Session.java:3006) at progress.message.jimpl.Session.run(Session.java:2397) at progress.message.jimpl.Session$SessionThread.run(Session.java:2782)

Can any one please help me in this?