We were using castor 0.9.5 for unmarshalling an xml which used xsi:types
to denote concrete types. However after upgrading to 0.9.5.3, it appears
that the unmarshaller is attempting to instantiate the abstract class
even when the xsi:type is specified. I have attached a snipped of the
xml. Note that this xml works perfectly with the same mapping file in
0.9.5.
The error we get with 0.9.3 is:
java.lang.IllegalStateException: Java schema change: Class
com.cna.app.service.communications.mapping.CvDocument can no longer be
constructed: com/cna/app/service/communications/mapping/CvDocument
at
org.exolab.castor.mapping.loader.Types.newInstance(Types.java:227)
at
org.exolab.castor.mapping.loader.Types.newInstance(Types.java:244)..etc.
etc..
Where CvDocument is the abstract class, but what should be instantiated
is CvElectronicDocument as described in the mapping below.
<cna:establishSpecifiedCommunicationContentCNARequest
xmlns:cna="http://www.ibm.com/industries/financialservices/cna">
<cna:containedDocuments cna:id="REF0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="cna:ElectronicDocument">
...
Here's a snippet of the mapping file..
<class
name="com.cna.app.service.communications.mapping.CvElectronicDocument"
extends="com.cna.app.service.communications.mapping.CvDocument"
identity="id" auto-complete="false">
<description>Default mapping for class
com.cna.app.service.communications.mapping.CvContainedDocuments</descrip
tion>
<map-to xml="cna:ElectronicDocument"/>
E-MAIL CONFIDENTIALITY NOTICE: The contents of this e-mail message and any
attachments are intended solely for the
addressee(s) and may contain confidential and/or legally privileged information. If
you are not the
intended recipient of this message or if this message has been addressed to you in
error, please
immediately alert the sender by reply e-mail and then delete this message and any
attachments. If you
are not the intended recipient, you are notified that any use, dissemination,
distribution, copying, or
storage of this message or any attachment is strictly prohibited.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev