Damon,.

when asking us for help, please try to send us as little information as possible, as 
otherwise we would have to plough through endless class mappings 
on the search for the correct one. Given the time we spend to help you out, I hope 
that we are not asking too much.

To help you with your problem, have a look at the following field mapping taken from 
your mapping file:

<field name="RdccTime"
         type="com.jbhunt.rdcc.application.RDCCJobTime"
         collection="ewe.util.Vector">
        <bind-xml name="rdccTime"/>
</field>

Assuming that you've read the documentation about available collection types when 
specifying 1:M relations, it should be plainly obvious that you 
cannot use your own collection classes with the collection attribute. Possible values 
(amongst others) are collection, arraylist, etc.

Werner

On Thu, 22 Jul 2004 08:30:32 -0500, M Damon Hill wrote:

>
>Ok, I have moved passed this issue for a moment at least of the
>StackOverflowError when Marshalling java objects to XML.
>I am now unmarshalling and can get SOME of the fields populated correctly.
>I have the same binding:
><?xml version="1.0"?>
><!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Ojbect Mapping DTD Version
>1.0//EN"
>       "http://castor.exolab.org/mapping.dtd";>
><mapping>
>       <class name="com.xxx.rdcc.application.RepairOrder">
>               <map-to xml="repairOrder"/>
>               <field name="_jobs"
>                          type="com.xxx.rdcc.application.OutboundJob"
>                                       collection="ewe.util.Vector"
>                          get-method="getJobs"
>                          set-method="setJobs">
>                          <bind-xml name="job"/>
>               </field>
>               <field name="_equipment"
>                          type="Equipment"
>                          required="true">
>                          <bind-xml name="equipment"/>
>               </field>
>               <field name="_repairOrderStartDate"
>                          type="string"
>                          required="true">
>                          <bind-xml name="repairOrderStartDate"/>
>               </field>
>               <field name="_deviceID"
>                          type="string"
>                          required="true">
>                          <bind-xml name="serialNumber"/>
>               </field>
>               <field name="_lastUpdateTime"
>                          type="string"
>                          required="true">
>                          <bind-xml name="lastUpdateTime"/>
>               </field>
>       </class>
>       <class name="com.xxx.rdcc.application.Shed">
>               <field name="_equipment"
>                      type="com.jbhunt.rdcc.application.Equipment"
>                               collection="ewe.util.Vector">
>                      <bind-xml name="equipment"/>
>               </field>
>       </class>
>       <!-- Only unmarshalling from the equipment xml -->
>       <class name="com.xxx.rdcc.application.Equipment">
>               <field name="_equipmentID"
>                      type="string"
>                      required="true">
>                      <bind-xml name="equipmentId"/>
>               </field>
>               <field name="_equipmentSpec"
>                      type="string"
>                      required="true">
>                      <bind-xml name="equipmentSpec"/>
>               </field>
>               <field name="_equipmentUnitNumber"
>                      type="string"
>                      required="true">
>                      <bind-xml name="equipmentUnitNumber"/>
>               </field>
>               <field name="_equipmentUnitPrefix"
>                      type="string"
>                      required="true">
>                      <bind-xml name="equipmentUnitPrefix"/>
>               </field>
>               <field name="_equipmentType"
>                      type="string"
>                      required="true">
>                      <bind-xml name="equipmentType"/>
>               </field>
>               <field name="_equipmentStatus"
>                      type="string"
>                      required="true">
>                      <bind-xml name="equipmentStatus"/>
>               </field>
>       </class>
>       <class name="com.xx.rdcc.application.FilingCabinet">
>               <field name="_currentJobs"
>                          type="com.jbhunt.rdcc.application.OutboundJob"
>                                       collection="ewe.util.Vector"
>                          get-method="getCurrentJobs"
>                          set-method="setCurrentJobs">
>                         <bind-xml name="filingCabinet"/>
>               </field>
>       </class>
>       <class name="com.xxx.rdcc.application.OutboundJob">
>               <map-to xml="job"/>
>               <field name="RdccTime"
>                          type="com.jbhunt.rdcc.application.RDCCJobTime"
>                                       collection="ewe.util.Vector">
>                          <bind-xml name="rdccTime"/>
>               </field>
>               <field name="Parts"
>                          type="com.jbhunt.rdcc.application.Part"
>                                       collection="ewe.util.Vector"
>                          required="false">
>                          <bind-xml name="part"/>
>               </field>
>               <field name="Picture"
>                          type="com.jbhunt.rdcc.application.Picture"
>                                       collection="ewe.util.Vector"
>                          required="false">
>                          <bind-xml name="picture"/>
>               </field>
>               <field name="JobStatus"
>                          type="string">
>                          <bind-xml name="jobStatus" node="element"/>
>               </field>
>               <field name="JobID"
>                          type="java.lang.String">
>                          <bind-xml name="jobID" node="element"/>      
>               </field>
>               <field name="JobType"
>                          type="java.lang.String"
>                          required="true">
>                          <bind-xml name="jobType" node="element"/>
>               </field>
>               <field name="TechnicianID"
>                          type="string">
>                          <bind-xml name="technicianID" node="element"/>
>               </field>
>               <field name="EquipmentNumber"
>                          type="string">
>                          <bind-xml name="equipmentNumber" node="element"/>
>               </field>
>               <field name="EquipmentPrefix"
>                          type="string">
>                          <bind-xml name="equipmentPrefix" node="element"/>
>               </field>
>               <field name="InventoryLocation"
>                          type="string">
>                          <bind-xml name="inventoryLocation"
>node="element"/>
>               </field>
>               <field name="InspectionRepairLocation"
>                          type="string">
>                          <bind-xml name="inspectionRepairLocation"
>node="element"/>
>               </field>
>               <field name="AccountCode"
>                          type="string">
>                          <bind-xml name="accountCode" node="element"/>
>               </field>
>               <field name="JobCode"
>                          type="string">
>                          <bind-xml name="jobCode" node="element"/>
>               </field>
>               <field name="Cause"
>                          type="string">
>                          <bind-xml name="cause" node="element"/>
>               </field>
>               <field name="JobPosition"
>                          type="string">
>                          <bind-xml name="jobPosition" node="element"/>
>               </field>
>               <field name="DamagePosition"
>                          type="string">
>                          <bind-xml name="damagePosition" node="element"/>
>               </field>
>               <field name="DamagedArea"
>                          type="string">
>                          <bind-xml name="damagedArea" node="element"/>
>               </field>
>               <field name="CorrectionCode"
>                          type="string">
>                          <bind-xml name="correctionCode" node="element"/>
>               </field>
>               <field name="Condition"
>                          type="string">
>                          <bind-xml name="condition" node="element"/>
>               </field>
>               <field name="WorkPerformed"
>                      type="string">
>                      <bind-xml name="workPerformed" node="element"/>
>               </field>
>       </class>
>       <class name="com.xxx.rdcc.application.RDCCJobTime">
>               <field name="_startTime"
>                          type="string"
>                          direct="true">
>                          <bind-xml name="startTime" node="element"/>
>               </field>
>               <field name="_startDate"
>                          type="string"
>                          direct="true">
>                          <bind-xml name="startDate" node="element"/>
>               </field>
>               <field name="_endTime"
>                          type="string"
>                          direct="true">
>                          <bind-xml name="endTime" node="element"/>
>               </field>
>               <field name="_endDate"
>                          type="string"
>                          direct="true">
>                          <bind-xml name="endDate" node="element"/>
>               </field>
>       </class>
>       <class name="com.xxx.rdcc.application.Part">
>               <field name="_partNumber"
>                          type="string"
>                          required="true">
>                          <bind-xml name="partNumber"/>
>               </field>
>               <field name="_partQuantity"
>                      type="string"
>                      required="true">
>                      <bind-xml name="partQuantity"/>
>               </field>
>               <field name="_tirePartRemoved"
>                      type="string">
>                      <bind-xml name="tirePartRemoved"/>
>               </field>
>               <field name="_tireTreadDepthRemoved"
>                          type="string">
>                          <bind-xml name="tireTreadDepthRemoved"/>
>               </field>
>               <field name="_tirePartInstalled"
>                          type="string">
>                          <bind-xml name="tirePartInstalled"/>
>               </field>
>               <field name="_tireTreadDepthInstalled"
>                          type="string">
>                          <bind-xml name="tireTreadDepthInstalled"/>
>               </field>
>       </class>
>       <class name="com.xxxx.rdcc.application.Picture">
>               <field name="_filename"
>                          type="string">
>                          <bind-xml name="before"/>
>               </field>
>               <field name="_filename"
>                          type="string">
>                          <bind-xml name="after"/>
>               </field>
>       </class>
>       <!-- only unmarshalling the spec not writing to it -->
>       <class name="com.xxxx.rdcc.application.Spec">
>               <field name="_specID"
>                          type="string"
>                          required="true">
>                          <bind-xml name="specId"/>
>               </field>
>               <field name="_jobNumber"
>                          type="string"
>                          required="true">
>                          <bind-xml name="jobNumber"/>
>               </field>
>               <field name="_jobPosition"
>                          type="string"
>                          required="true">
>                          <bind-xml name="jobPosition"/>
>               </field>
>               <field name="_partNumber"
>                          type="string"
>                          required="true">
>                          <bind-xml name="partNumber"/>
>               </field>
>               <field name="_minQuantity"
>                          type="string"
>                          required="true">
>                          <bind-xml name="minQuantity"/>
>               </field>
>               <field name="_maxQuantity"
>                          type="string"
>                          required="true">
>                          <bind-xml name="maxQuantity"/>
>               </field>
>               <field name="_status"
>                          type="string"
>                          required="true">
>                          <bind-xml name="status"/>
>               </field>
>       </class>
></mapping>
>I am attempting to map this xml file
><job>
>               <jobstatus>new</jobstatus>
>               <jobid>111</jobid>
>               <jobtype>EDRInspection</jobtype>
>               <technicianid>012345</technicianid>
>               <equipmentnumber>861116</equipmentnumber>
>               <equipmentprefix>JBHZ</equipmentprefix>
>               <technicianname>Damon Hill</technicianname>
>               <jobdescription>RAIL, BARE CHASSIS INSPECTION -
>DNUS</jobdescription>
>               <rdcctime>
>                       <starttime>13:05</starttime>
>                       <startdate>07222004</startdate>
>                       <endtime>13:35</endtime>
>                       <enddate>07222004</enddate>
>               </rdcctime>
>               <inventorylocation>CHIRIL</inventorylocation>
>               <inspectionrepairlocation>IR</inspectionrepairlocation>
>               <accountcode>425</accountcode>
>               <jobcode>105</jobcode>
>               <cause>damage</cause>
>               <jobposition>09</jobposition>
>               <damageposition>11</damageposition>
>               <damagedarea>roof</damagedarea>
>               <correctioncode/>
>               <condition>busted to hell</condition>
>               <workperformed>Fixed this sucka!</workperformed>
></job>
>
>Now when I take out the <rdcctime> element, it works correctly and
>everything maps.
>However, when I add the rdcctime element in, I get the following
>NullPointerException:
>
>java.lang.NullPointerException
>        at
>org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:16
>35)
>        at
>org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:12
>92)
>        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
>Source)
>        at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unkno
>wn Source)
>        at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
>her.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:605)
>        at
>org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:718)
>        at
>com.jbhunt.rdcc.resources.RDCDataManipulation.loggedOnAJob(RDCDataManipulati
>on.java:313)
>        at
>com.jbhunt.rdcc.resources.RDCDataManipulation.main(RDCDataManipulation.java:
>1780)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>        at java.lang.reflect.Method.invoke(Unknown Source)
>        at ewe.reflect.Method.invokeInThread(Method.java)
>        at ewe.reflect.Method.nativeInvoke(Method.java)
>        at ewe.reflect.Method.invoke(Method.java)
>        at ewe.ui.mApp$2.run(mApp.java)
>        at ewe.sys.Coroutine.run(Coroutine.java)
>
>Thanks in advance
>Damon
>
>
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
>        unsubscribe castor-user
>
>
>
>----------------------------------------------------------- 
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
>        unsubscribe castor-user
>



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to