Don't use the -nodesc option. That's an advanced option which prevents
the generated descriptor files. If you use the -nodesc option, you'll
need a mapping file. So my recommendation is to NOT use that option,
generate the descriptors and compile them.
--Keith
> Stefan H Westlund wrote:
>
> Hello!
> I'm changing from JAXB to Castor so I'm quite new to this. I got an
> Exception during unmarshalling an XML inputstream.
> I generated the Java object from the primer.xsd by:
>
> javac -cp $CLASSPATH org.exolab.castor.builder.SourceGenerator -i
> primer.xsd -package primer
>
> And if I use -nodesc (in the path) I will get an
> org.xml.sax.SAXException: Illegal Text data found as child of: words
> value: "1"
> The thing is that I had used this primer.xsd with JAXB and the xjc
> generator command and I could unmarshall the stream without problem.
>
> By the way... When compiling the generated Java sourcefiles I will
> get:
>
> Note: Some input files use or override a deprecated API.
> Note: Recompile with -deprecation for details.
>
> This is because the org.xml.sax.DocumentHandler is deprecated. Is this
> correct?
> Could someone tell me what I am doing wrong?
>
> Best Regards/
> Stefan H Westlund
>
> --------------------------------------------------------------------------------------------------------------------
>
> The Stack Trace:
>
> org.xml.sax.SAXException: unable to create XMLClassDescriptor for
> class: primer.Root
> at
> org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:980)
> at
> org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:411)
> at
> org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:778)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:823)
> at
> org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:1028)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1610)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:348)
> at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:539)
> at
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)
> at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
> at
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1125)
> at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:555)
> at granska.MyFrame.getRoot(MyFrame.java:268)
> at granska.MyFrame.access$2(MyFrame.java:131)
> at granska.MyFrame$AnalyzeThread.run(MyFrame.java:333)
> ----------------------------------------------------------------------------------------------------
>
> The Java Sourcecode:
>
> try {
> char[] chars = _text.toCharArray();
> HttpURLConnection servletConnection =
> (HttpURLConnection)MyStatic.getServletURL(
> "analyze").openConnection();
> servletConnection.setDoOutput( true);
> servletConnection.setDoInput( true);
> servletConnection.setUseCaches( false);
> servletConnection.setRequestMethod( "POST");
> servletConnection.setRequestProperty( "Content-length",
> String.valueOf( chars.length));
> servletConnection.connect();
> OutputStreamWriter toServlet = new OutputStreamWriter(
> servletConnection.getOutputStream());
> toServlet.write("text=");
> toServlet.write( chars);
> toServlet.flush();
> toServlet.close();
> InputSource source = new InputSource(
> servletConnection.getInputStream());
> source.setEncoding( "UTF-8");
> Unmarshaller unmarshaller = new Unmarshaller( Root.class);
> unmarshaller.setIgnoreExtraElements( true);
> unmarshaller.setValidation( false);
> Root root = (Root)unmarshaller.unmarshal( source);
> return root;
> } catch( Exception e) {
> e.printStackTrace();
> }
>
> ----------------------------------------------------------------------------------------------------------
>
> The XML Sample:
>
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> <Root><s ref="0"><words>1</words>
> <text>test</text>
> <contents><w no="0" tag="nn.neu.sin.ind.nom" lemma="test">test</w>
> </contents>
> <matchings><match begin="0" end="0">[EMAIL PROTECTED]</match>
> <match begin="0" end="0"
> features="nn.neu.sin.def.nom">[EMAIL PROTECTED]</match>
> </matchings>
> <analysis><clause><ph type="NPmin" pos="0">test</ph>
> </clause>
> </analysis>
> <bio><row>test nn.neu.sin.ind.nom NPB CLB</row>
> <row/>
> </bio>
> <models><model name="unit"><probcheck begin="1" end="-1"
> clause_from="0" clause_to="0"><note>slutord -1 �r mindre �n startord
> 1</note>
> </probcheck>
> <errors_found><row_err>test nn.neu.sin.ind.nom ok</row_err>
> <row_err/>
> </errors_found>
> <result>-11</result>
> </model>
> </models>
> <final_result>-11</final_result>
> </s>
> <scrutinizer></scrutinizer>
> <results><summary><method>unit</method>
> <error_thresh>0.5</error_thresh>
> <errors_known>0</errors_known>
> <detected_errors>0</detected_errors>
> <style_errors>0</style_errors>
> <false_alarms>0</false_alarms>
> <total_alarms>0</total_alarms>
> <coverage>NaN</coverage>
> <precision>NaN</precision>
> </summary>
> <alarm_details><spelling_errors><total cov="NaN">0</total>
> <sem_gram_err cov="NaN">0</sem_gram_err>
> <verb_err cov="NaN">0</verb_err>
> <compound_err cov="NaN">0</compound_err>
> <other cov="NaN">0</other>
> </spelling_errors>
> <word_err><total cov="NaN">0</total>
> <missing cov="NaN">0</missing>
> <order cov="NaN">0</order>
> </word_err>
> <misc><total cov="NaN">0</total>
> <style cov="NaN">0</style>
> <foreign cov="NaN">0</foreign>
> <tok_sent cov="NaN">0</tok_sent>
> <bad_tag cov="NaN">0</bad_tag>
> <other cov="0">0</other>
> </misc>
> </alarm_details>
> <rules><scrut_rules></scrut_rules>
> <rules_used_per_category></rules_used_per_category>
> <rules_not_used><rule>[EMAIL PROTECTED]</rule>
> <rule>[EMAIL PROTECTED]</rule>
> </rules_not_used>
> </rules>
> </results>
> <tags><tag no="0" name="nn.neu.sin.def.nom"/>
> <tag no="1" name="nn.utr"/>
> <tag no="2" name="hd.utr/neu.plu.ind"/>
> <tag no="3" name="jj.pos.sms"/>
> <tag no="4" name="dt.utr/neu.plu.def"/>
> <tag no="5" name="hs.def"/>
> <tag no="6" name="jj.kom.utr/neu.sin/plu.ind/def.nom"/>
> <tag no="7" name="jj.pos.utr/neu.plu.ind/def.nom"/>
> <tag no="8" name="dt.utr.sin.ind/def"/>
> <tag no="9" name="dt.utr/neu.sin.def"/>
> <tag no="10" name="nn.neu.plu.ind.gen"/>
> <tag no="11" name="nn"/>
> <tag no="12" name="nn.utr.plu.def.nom"/>
> <tag no="13" name="jj.pos.neu.sin.ind/def.nom"/>
> <tag no="14" name="nn.utr.sin.def.nom.dat"/>
> <tag no="15" name="vb.imp.akt.aux"/>
> <tag no="16" name="ps.utr.sin.def"/>
> <tag no="17" name="jj.pos.utr/neu.plu.ind.nom"/>
> <tag no="18" name="dt.utr/neu.plu.ind/def"/>
> <tag no="19" name="nn.utr.sin.ind.nom.dat"/>
> <tag no="20" name="hd.neu.sin.ind"/>
> <tag no="21" name="vb.prt.sfo.kop"/>
> <tag no="22" name="sen.que"/>
> <tag no="23" name="dt.utr/neu.plu.ind"/>
> <tag no="24" name="nn.neu"/>
> <tag no="25" name="pn.neu.sin.ind.sub/obj"/>
> <tag no="26" name="pn.utr/neu.plu.def.sub/obj"/>
> <tag no="27" name="hp"/>
> <tag no="28" name="ps.utr/neu.sin/plu.def"/>
> <tag no="29" name="pn.utr/neu.plu.def.obj"/>
> <tag no="30" name="vb.prt.akt.aux"/>
> <tag no="31" name="nn.utr.sin.ind.nom"/>
> <tag no="32" name="ro"/>
> <tag no="33" name="nn.utr.plu.def.gen"/>
> <tag no="34" name="nn.neu.plu.ind.nom"/>
> <tag no="35" name="nn.neu.sin.def.gen"/>
> <tag no="36" name="nn.sms"/>
> <tag no="37" name="jj.suv.mas.sin.def.nom"/>
> <tag no="38" name="jj.suv.utr/neu.sin/plu.def.nom"/>
> <tag no="39" name="vb.prs.sfo"/>
> <tag no="40" name="pm.nom"/>
> <tag no="41" name="sen.hea"/>
> <tag no="42" name="nn.utr.sin.def.nom.set"/>
> <tag no="43" name="sn"/>
> <tag no="44" name="ab.kom"/>
> <tag no="45" name="pad"/>
> <tag no="46" name="dt.utr/neu.sin.ind"/>
> <tag no="47" name="vb.imp"/>
> <tag no="48" name="pn.utr.sin.def.sub/obj"/>
> <tag no="49" name="pn.utr.sin.def.obj"/>
> <tag no="50" name="rg.utr/neu.plu.ind/def.nom"/>
> <tag no="51" name="jj.pos.utr/neu.sin.def.nom"/>
> <tag no="52" name="sen.exc"/>
> <tag no="53" name="rg.utr.sin.ind.nom"/>
> <tag no="54" name="vb.prs.akt"/>
> <tag no="55" name="pm.gen"/>
> <tag no="56" name="dt.utr.sin.ind"/>
> <tag no="57" name="dt.utr/neu.sin/plu.ind"/>
> <tag no="58" name="nn.utr.sms"/>
> <tag no="59" name="vb.inf.akt.aux"/>
> <tag no="60" name="pn.utr.sin.def.sub"/>
> <tag no="61" name="kn"/>
> <tag no="62" name="vb.prs.sfo.kop"/>
> <tag no="63" name="vb.prs.akt.mod"/>
> <tag no="64" name="vb.inf.akt.mod"/>
> <tag no="65" name="pc.gen"/>
> <tag no="66" name="ro.nom"/>
> <tag no="67" name="jj.pos.neu.sin.ind.nom"/>
> <tag no="68" name="nn.utr.plu.ind.nom"/>
> <tag no="69" name="pn.utr.sin.ind.sub"/>
> <tag no="70" name="jj.suv.utr/neu.plu.def.nom"/>
> <tag no="71" name="dt.neu.sin.def"/>
> <tag no="72" name="rg.sin"/>
> <tag no="73" name="ro.sin"/>
> <tag no="74" name="vb.imp.akt.kop"/>
> <tag no="75" name="hd.utr.sin.ind"/>
> <tag no="76" name="nn.neu.sin.def.nom.set"/>
> <tag no="77" name="vb.kon.prs.akt"/>
> <tag no="78" name="ab.suv"/>
> <tag no="79" name="vb.inf.akt"/>
> <tag no="80" name="jj.pos.utr.sin.ind.nom"/>
> <tag no="81" name="nn.neu.plu.def.gen"/>
> <tag no="82" name="vb.imp.akt.mod"/>
> <tag no="83" name="vb.prt.akt.mod"/>
> <tag no="84" name="dt.neu.sin.ind"/>
> <tag no="85" name="pn.utr/neu.plu.ind.sub/obj"/>
> <tag no="86" name="pn.neu.sin.def.sub/obj"/>
> <tag no="87" name="vb.inf.akt.kop"/>
> <tag no="88" name="rg.neu.sin.ind.nom"/>
> <tag no="89" name="pn.mas.sin.def.sub/obj"/>
> <tag no="90" name="ro.gen"/>
> <tag no="91" name="nn.neu.plu.def.nom"/>
> <tag no="92" name="dt.mas.sin.ind/def"/>
> <tag no="93" name="dt.neu.sin.ind/def"/>
> <tag no="94" name="vb.inf.sfo"/>
> <tag no="95" name="jj.suv.utr/neu.sin/plu.ind.nom"/>
> <tag no="96" name="rg.gen"/>
> <tag no="97" name="hp.neu.sin.ind"/>
> <tag no="98" name="vb.kon.prt"/>
> <tag no="99" name="sen.per"/>
> <tag no="100" name="ps.utr/neu.plu.def"/>
> <tag no="101" name="nn.utr.sin.ind.nom.set"/>
> <tag no="102" name="nn.utr.sin.def.nom"/>
> <tag no="103" name="pn.utr.plu.def.sub"/>
> <tag no="104" name="nn.neu.sin.ind.gen"/>
> <tag no="105" name="ps.neu.sin.def"/>
> <tag no="106" name="pn.utr.plu.def.obj"/>
> <tag no="107" name="jj.pos.utr.sin.ind/def.nom"/>
> <tag no="108" name="vb.prt.sfo"/>
> <tag no="109" name="mad"/>
> <tag no="110" name="ab"/>
> <tag no="111" name="pn.utr/neu.sin/plu.def.obj"/>
> <tag no="112" name="vb.sup.akt"/>
> <tag no="113" name="mid"/>
> <tag no="114" name="vb.sup.akt.kop"/>
> <tag no="115" name="jj.pos.mas.sin.def.nom"/>
> <tag no="116" name="hp.utr/neu.plu.ind"/>
> <tag no="117" name="vb.sup.akt.mod"/>
> <tag no="118" name="jj.kom.sms"/>
> <tag no="119" name="nn.utr.sin.def.gen"/>
> <tag no="120" name="rg.nom"/>
> <tag no="121" name="nn.neu.sin.ind.nom"/>
> <tag no="122" name="rg.yea"/>
> <tag no="123" name="pl"/>
> <tag no="124" name="in"/>
> <tag no="125" name="vb.prt.akt"/>
> <tag no="126" name="nn.neu.sms"/>
> <tag no="127" name="vb.sup.sfo"/>
> <tag no="128" name="nn.utr.plu.ind.gen"/>
> <tag no="129" name="pn.utr.sin.ind.sub/obj"/>
> <tag no="130" name="dt.utr.sin.def"/>
> <tag no="131" name="nn.neu.sin.ind.nom.set"/>
> <tag no="132" name="vb"/>
> <tag no="133" name="pp"/>
> <tag no="134" name="vb.prs.akt.kop"/>
> <tag no="135" name="nn.utr.sin.ind.gen"/>
> <tag no="136" name="jj.gen"/>
> <tag no="137" name="vb.prt.akt.kop"/>
> <tag no="138" name="ie"/>
> <tag no="139" name="ro.mas.sin.ind/def.nom"/>
> <tag no="140" name="jj.pos.utr/neu.sin/plu.ind/def.nom"/>
> <tag no="141" name="hp.utr.sin.ind"/>
> <tag no="142" name="pc.prs.utr/neu.sin/plu.ind/def.nom"/>
> <tag no="143" name="sen.non"/>
> <tag no="144" name="pn.utr/neu.plu.def.sub"/>
> <tag no="145" name="ha"/>
> <tag no="146" name="vb.prs.akt.aux"/>
> <tag no="147" name="ab.pos"/>
> <tag no="148" name="pm.sms"/>
> </tags>
> <rules><categories><category><name>nprecog</name>
> <count>0</count>
> </category>
> <category><name>abrecog</name>
> <count>0</count>
> </category>
> <category><name>qnrecog</name>
> <count>0</count>
> </category>
> <category><name>acc</name>
> <count>0</count>
> </category>
> <category><name>jjrecog</name>
> <count>0</count>
> </category>
> <category><name>vbrecog</name>
> <count>0</count>
> </category>
> <category><name>clrecog</name>
> <info>CL</info>
> <count>0</count>
> </category>
> <category><name>pprecog</name>
> <count>0</count>
> </category>
> <category><name>prob</name>
> <info>PROB</info>
> <count>0</count>
> </category>
> </categories>
> <rules_used></rules_used>
> </rules>
> </Root>
>
> --------------------------------------------------------------------------------------------------
>
> The primer.xsd file:
>
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Root">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="s" minOccurs="0" maxOccurs="unbounded">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="words" >
> <xs:complexType>
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="text" >
> <xs:complexType>
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="paragraph" minOccurs="0" >
> <xs:complexType>
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="contents" >
> <xs:complexType>
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="matchings" >
> <xs:complexType minOccurs="0">
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="analysis" >
> <xs:complexType minOccurs="0">
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="bio" minOccurs="0" >
> <xs:complexType>
> <xs:sequence>
> <xs:element name="row" type="xs:string" minOccurs="0"
> maxOccurs="unbounded" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="models" >
> <xs:complexType minOccurs="0">
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="final_result" >
> <xs:complexType minOccurs="0">
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="sent_comm" minOccurs="0" >
> <xs:complexType minOccurs="0">
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> <xs:attribute name="ref" type="xs:integer" use="optional" />
> </xs:complexType>
> </xs:element>
> <xs:element name="scrutinizer" minOccurs="0" >
> <xs:complexType minOccurs="0">
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="results" minOccurs="0" >
> <xs:complexType minOccurs="0" >
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="tags" minOccurs="0" >
> <xs:complexType minOccurs="0" >
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="rules" minOccurs="0" >
> <xs:complexType minOccurs="0" >
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev