Hello Eric,
Thanks for the information. That appeared to be the problem. I
have a new error now, and it deals with the dates. Xerces validates the
XML fine, but Castor is throwing an exception with illegal text data
found as child of an element. Error message is below. Is this going to
be Castor or the Xerces parser being used at runtime? I haven't changed
the Castor defaults so it is using Xerces. Also, just wondering about
the Descriptor classes. Is there a reason they are not included in the
code for compiliation? I realize they are created at runtime, but I'm
asking because I may put some code into Castor to do something like
this. In the top element or each Type that a descriptor is created for:
static void compileDescriptor()
{
DataTypeDescriptor d = null;
}//end compileDescriptor
I may add code to Castor to output a method like that to the class which
the descriptor was created for, or maybe something like this in the top
element class
static void comipleDescriptor()
{
TopElementDescriptor d1 = null;
DataType2Descriptor d2 = null;
}//end compileDescriptor
Does anyone see a problem with adding code to do that? Are they only
included at runtime for any special reason? I assume we'll only have
one descriptor per Schema or set of classes per class that is. Let me
know. I'll be glad to work on that.
Any help with this error is greatly appreciated:
Unmarshalling:
C:\projects\Redesetgrow\SCDHEC\Node\src\net\scdhec\node\castor\frs22\xml
\frs22_test_data.xml
Usage: java FacilitySiteList <input file> <output file>
org.xml.sax.SAXException: Illegal Text data found as child of:
EnvironmentalInterestStartDate
value: "1967-08-13"{file: [not available]; line: 34; column: 79}
org.xml.sax.SAXException: Illegal Text data found as child of:
EnvironmentalInterestStartDate
value: "1967-08-13"
at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:
690)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unk
nown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(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(FacilitySiteList
.java:97)
at
net.scdhec.node.castor.frs22.FacilitySiteList.main(FacilitySiteList.java
:143)
Thank you for your help,
Wade Chandler
Software Engineer
Red-e Set Grow, LLC
Winston Salem, NC
Phone: 336-777-0075 ext. 105
Email: [EMAIL PROTECTED]
-----Original Message-----
From: Ostermueller, Erik [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 9:40 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Issue with XML names and dashes. Help needed.
If you're using source generated by the SourceGenerator,
have you verified that the *Descriptor.java files are getting compiled?
Are the *Descriptor.class files making it into the classpath?
There are no hard compile-time dependencies upon these *Descriptor.java
files. Some IDE compile commands rely only on compile-time dependencies.
The these files don't get compiled, default xml naming rules
unexpectedly kick in.
> -----Original Message-----
> From: Wade Chandler [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 11, 2003 9:26 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] Issue with XML names and dashes.
> Help needed.
>
>
> Oh yeah, the overall problem is still the same however. I'm
> getting all
> of the same error messages just instead of -'s in the XML name being
> used to lookup info I am getting an element name with a lower case as
> the first letter when it should be capitalized. Thanks again.
>
> -----Original Message-----
> From: Joe Trausch [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 11, 2003 8:52 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] Issue with XML names and dashes.
> Help needed.
>
>
> Wade,
>
> I believe the problem is in your castor.properties file. The excerpt
> below shows how to set naming behavior in the properties file:
>
> # Defines the Naming "style" or conventions to use when
> # creating XML names from Java class or field names.
> # Valid values are as follows:
> # -----------------------------------------------------------------
> # lower (default) | All names are lowercase with hyphens
> # | separating words.
> # |
> # | Example: personInfo = person-info
> # -----------------------------------------------------------------
> # mixed | All names are mixed case, with Uppercase
> # | character as the first letter of a new word.
> # |
> # | Example: personInfo = personInfo
> # | Example: FooBar = fooBar
> # -----------------------------------------------------------------
> # {Any ClassName} | Any Class which implements
> # | org.exolab.castor.xml.XMLNaming
> # -----------------------------------------------------------------
> #
> # By default all names are treated as the "lower" option.
> # To preserve the Java mixed-case conventions simply
> # uncomment the following line.
> #
> org.exolab.castor.xml.naming=mixed
>
> Joe Trausch
>
> -----Original Message-----
> From: Wade Chandler [mailto:[EMAIL PROTECTED]
> Sent: Saturday, August 09, 2003 9:15 PM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Issue with XML names and dashes. Help needed.
>
>
> This may seem like a stupid question, but does anyone know what the
> syntax might be in the Castor XML Binding file to make Castor not
> generate XML names with -'s in them? I have found this may be the
> cause of my problem. I made my classes and was debugging the
> Castor code when
> I ran over the getXmlName() function and am seeing an XML
> Name value of
> facility-site-list when I need to be seeing FacilitySiteList.
> Any help
> is greatly appreciated.
>
> Thank you,
>
> Wade Chandler
>
> -----Original Message-----
> From: Wade Chandler [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 1: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
>
> -----------------------------------------------------------
> 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
>
>
> DISCLAIMER:
> This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and
> destroy all copies of the original message and attachments.
>
-----------------------------------------------------------
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