Hi all:
For the following mapping file...
<class name="org.ayrna.random.IRandGen" verify-constructable="false">
<description>mapping for IRandGen interface</description>
</class>
<class name="org.ayrna.random.RandGen" verify-constructable="false"
extends="org.ayrna.random.IRandGen">
<description>mapping for RandGen class</description>
</class>
<class name="org.ayrna.random.Ranecu"
extends="org.ayrna.random.RandGen">
<map-to xml="ranecu"/>
<field name="seed1" type="int">
<n:bind-xml name="seed1" node="element"/>
</field>
<field name="seed2" type="int">
<n:bind-xml name="seed2" node="element"/>
</field>
</class>
<class name="org.ayrna.jclec.IMutator" verify-constructable="false">
<description>mapping for IMutator interface</description>
</class>
<class name="org.ayrna.jclec.base.AbstractMutator"
extends="org.ayrna.jclec.IMutator" verify-constructable="false">
<field name="randgen" type="org.ayrna.random.IRandGen">
<bind-xml name="randgen" node="element"/>
</field>
</class>
<class name="org.ayrna.jclec.binarray.BinArrayMutator"
extends="org.ayrna.jclec.base.AbstractMutator"
verify-constructable="false">
<field name="mschema" type="byte" collection="array">
<bind-xml name="locus" node="element"
location="mschema"/>
</field>
<field name="fmp" type="int">
<bind-xml name="fmp" node="element"/>
</field>
<field name="lmp" type="int">
<bind-xml name="lmp" node="element"/>
</field>
</class>
<class name="org.ayrna.jclec.binarray.OneLocusMutator"
extends="org.ayrna.jclec.binarray.BinArrayMutator">
</class>
If I marshall an instance of OneLocusMutator class, I get
<?xml version="1.0" encoding="UTF-8"?>
<one-point-crossover>
<randgen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ranecu">
<seed1>12345</seed1>
<seed2>67890</seed2>
</randgen>
<fcp>0</fcp>
<lcp>10</lcp>
</one-point-crossover>
and, if I remove �xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance",
that is, if I use
<one-point-crossover>
<randgen xsi:type="ranecu">
<seed1>12345</seed1>
<seed2>67890</seed2>
</randgen>
<fcp>0</fcp>
<lcp>10</lcp>
</one-point-crossover>
and I try to unmarshall the object, I get the following exception
unable to instantiate a new type of: org.ayrna.random.IRandGen
org.xml.sax.SAXException: unable to instantiate a new type of:
org.ayrna.random.IRandGen
at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav
a:2188)
at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav
a:1330)
at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U
nknown 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.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:657)
at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:565)
at
org.ayrna.jclec.binarray.OnePointCrossoverTests.testUnmarshall(OnePointC
rossoverTests.java:149) ...
what is it wrong?
Thanks in advance.
Sebasti�n Ventura Soto
Dpt. of Computer Sciences and Numerical Analysis. University de C�rdoba.
Campus Univ. de Rabanales. Edificio "Einstein". 3� planta.
14071 - C�rdoba (Spain)
Tel +34(0) 957218349
Fax +34(0) 957218630
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------