hi,

  i wrote up a quick & dirty implementation of the usage pattern
  for xsi:type that i got to work just fine with 0.9.4

  (source attached as sample.jar)

  i hope this helps.

/ eitan

----- Original Message -----
From: "Frederick N. Brier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 10:39 PM
Subject: [castor-dev] xsi:type and interface example


> Several other people have posted questions on this, but I haven't seen a
> response yet.  I am attempting to do exactly what the Castor XML example
> discusses:
>
> http://castor.exolab.org/xml-mapping.html#5.-xsi:type
>
> Unfortunately, it doesn't work for me, and I am not entirely clear on the
> syntax.  The exception I get with Castor 0.9.3.19 when attempting to
> Unmarshal is:
>
> java.lang.IllegalStateException: Java schema change: Class
> com.abc.MyInterface can no longer be constructed: com.abc.MyInterface
>
> com.abc.MyInterface would be the equivalent of the IProcessor interface in
> the example.  The error message is different when using Castor 0.9.4.  I
> saw one post that traced the error to Castor calling newInstance() on the
> interface.  But there was no response.  So how do you avoid this?  My
> mapping file actually has the XML to Java object mapping for the 3 classes
> that implement the com.abc.MyInterface.  Is that causing a problem?  I
> understand examples are trimmed back to a minimum, but would the
following:
>
> <engine>
>     <processor xsi:type="java:com.abc.MyProcessor" />
> </engine>
>
> With some dummy data fields actually look more like:
>
> <engine>
>     <name>The Super Engine</name>
>     <processor xsi:type="java:com.abc.MyProcessor">
>         <numPhases>10</numPhases>
>         <cost>100.00</cost>
>     </processor>
> </engine>
>
> It also makes no difference whether I include the required="true"
attribute
> in the example.  Do I need any other additional XML syntax other than
> exactly what is in the above dummy field example?  Thank you for you
> assistance.
>
> Frederick N. Brier
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>

Attachment: sample.jar
Description: Binary data

Reply via email to