Hi Wade,

Could you please post the XML schema and the XML that you use to
demonstrate the problem?
To help you track down the issue, you can turn debug on. It will give
you (very!) little information on what is going on.
>From the error description, it seems that a sanity check is missing.

Thanks,

Arnaud
> -----Original Message-----
> From: Wade Chandler [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 08, 2003 7:22 PM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] java.lang.NullPointerException in 
> org.exolab.castor.xml.UnmarshalHandler
> 
> 
> I wrote to the group yesterday.  I thought maybe my subject 
> line wasn't good enough to get read so I thought I might put 
> the exact problem into the message subject.  Any help is 
> greatly appreciated.
> 
> Thank you,
> 
> Wade Chandler
> 
> -----Original Message-----
> From: Wade Chandler [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, August 07, 2003 7:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] Having a problem with what I would 
> assume is pretty simple using 0.9.5
> 
> 
> Ok, I have tract where the error is being raised to 
> org.exolab.castor.xml.UnmarshalHandler line 1090 in the snap 
> shot I have.  If you notice line 1054 where the while loop 
> for isContainer and !canAccept is.  The first piece of the 
> while condition is to make sure that parentState.fieldDesc != 
> null using a short circuit and.  Then go back down to 1090 
> and you'll see that no where in the code in that section is 
> there a test for fieldDesc != null.  Thus when it is accessed 
> the NullPointer exception.  Now I have to find out what that 
> field fieldDesc of UnmarshalState is.  Any further assistance 
> would be a big help.  I'm completely new to Castor.  Thanks 
> for all of your help.
> 
> Wade Chandler
> [EMAIL PROTECTED]
> 
> -----Original Message-----
> From: Wade Chandler [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, August 07, 2003 7:14 PM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Having a problem with what I would 
> assume is pretty simple using 0.9.5
> 
> 
> Hello All,
> 
> I am using Castor 0.9.5.
> 
> I have this code:
> 
>    /**
>     *Method used to test the full package.
>     *FacilitySiteList is the main element, and this is the 
> main method for that class.
>     *The xml file I'm using was create with the same schema 
> that created this class package in Castor.
>     *The xml file was created using XML Spy 5.0 Enterprise.
>     */
>    public static void main(String args[])
>    {
>       try
>       {
>          //we need to check the first parameter to see if it 
> is a file.
>          java.io.File param1 = new java.io.File(args[0]);
>          if( !param1.isFile() )
>          {
>             throw new Exception("The input isn't a File.");
>          }
>          
>          if(args.length < 2 )
>          {
>             printUsage();
>             return;
>          }
>          
>          if(args[1].length() < 2)
>          {
>             throw new Exception("The output would not be a 
> valid file.");
>          }//end if
>          
>          //now we need to setup our reader and writer.
>          java.io.FileWriter out = new java.io.FileWriter(args[1]);
>          java.io.FileReader in = new java.io.FileReader(param1);
>          
>          System.out.println("Unmarshalling: " + 
> param1.getCanonicalPath());
>          FacilitySiteList fsl = FacilitySiteList.unmarshal(in);
>          
>          System.out.println("Marshalling: " + args[0] + " to 
> " + args[1]);
>          fsl.marshal(out);
>          
>          
>       }
>       catch(Exception e)
>       {
>          printUsage();
>          System.out.println(e.toString());
>          e.printStackTrace();
>       }
>       
>    }//end main
> 
> It is producing this error:
> 
> Unmarshalling: 
> C:\projects\Redesetgrow\SCDHEC\Node\src\net\scdhec\node\castor
> \frs22\xml
> \frs22_test_data.xml
> Usage: java FacilitySiteList <input file>  <output file> 
> java.lang.NullPointerException java.lang.NullPointerException
>         at 
> org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalH
> andler.jav
> a:1090)
>         at 
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkno
> wn Source)
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> tElement(U
> nknown Source)
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
> ContentDis
> patcher.dispatch(Unknown Source)
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> ment(Unkno
> wn Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.DTDConfiguration.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:555)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:487)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:627)
>         at 
> net.scdhec.node.castor.frs22.FacilitySiteList.unmarshal(Facili
> tySiteList
> .java:96)
>         at 
> net.scdhec.node.castor.frs22.FacilitySiteList.main(FacilitySit
> eList.java
> :139)
> 
> The file I'm inputting was produced with the schema from XML 
> Spy.  I can't figure out why castor is getting an error.  I 
> have validated the xml inside of Netbeans 3.5 using Xerces.  
> It validated fine.  I also checked the the xml inside of 
> Netbeans.  It seemed to be able to parse the file fine.  I 
> can send the schema's (there are many included schema) and 
> the xml file if anyone is willing to help with that.
> 
> Any help is greatly appreciated.
> 
> Thank you,
> 
> Wade Chandler
> [EMAIL PROTECTED]
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to 
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to 
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to 
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev
> 

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

Reply via email to