Hi Bryan,
Sounds like an inheritence issue here. Castor is probably confused on a
certain field, and thinks it's a local field and not an inherited field,
thereby causing the localIdx counter to be erroneously incremented, and
eventually causing an ArrayIndexOutOfBoundsException.
I'd have to see the issue first hand in order to debug it. Do you have
an example you can send me?
Thanks,
--Keith
> Bryan Field-Elliot wrote:
>
> I'm using Castor 0.9.5, with generated source files from a new version
> of a schema. Whenever I try to marshal one of my objects, I get this
> exception:
>
> Stack Trace: java.lang.ArrayIndexOutOfBoundsException: 12
>
> at
> org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:777)
> at org.exolab.castor.xml.Validator.validate(Validator.java:122)
> at org.exolab.castor.xml.Validator.validate(Validator.java:83)
> at org.sourceid.sso.util.XMLUtils.marshalToDocument(XMLUtils.java:311)
>
> This clearly isn't a validation exception, something else is occuring.
> Could I be doing something wrong? The relevent code in
> XMLClassDescriptorImpl is here:
>
> //-- get local element descriptors by filtering
> //-- out inherited ones
> XMLFieldDescriptor[] inherited =
> _extends.getElementDescriptors();
> XMLFieldDescriptor[] allElements = localElements;
> localElements = new XMLFieldDescriptor[allElements.length
> - inherited.length];
> int localIdx = 0;
> for (int i = 0; i < allElements.length; i++) {
> XMLFieldDescriptor desc = allElements[i];
> boolean isInherited = false;
> for (int idx = 0; idx < inherited.length; idx++) {
> if (inherited[idx].equals(desc)) {
> isInherited = true;
> break;
> }
> }
> if (!isInherited) {
> localElements[localIdx] = desc; // EXCEPTION
> OCCURS HERE
> ++localIdx;
> }
> }
>
> Any help would be appreciated.
>
> Thank you,
> Bryan
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev