Title: MarshalException trying to parse subelement from imported schema

All,

I'm seeing the following error unmarshaling a document immediately after marshaling that document with the same generated classes:

org.exolab.castor.xml.MarshalException: unable to find FieldDescriptor for 'PolicyCacheControl' in ClassDescriptor of J2EEConfigType

My document is based on two XML schemas, with one (xmlns="http://www.entegrity.com/assureaccess") importing the other (xmlns="http://www.entegrity.com/assureservices").  Using the source generator, I built classes for both schemas into two different Java packages and used castorbuilder.properties and the org.exolab.castor.builder.nspackages property to keep the packages straight (works great).

Here is a simplified version of a document that exhibits the problem:

<?xml version="1.0" encoding="UTF-8"?>
<AdapterConfigs xmlns="http://www.entegrity.com/assureaccess">
        <J2EEConfig>
                <ns1:PolicyCacheControl xmlns:ns1="http://www.entegrity.com/assureservices">                            <ns1:PolicyCache>Forever</ns1:PolicyCache>

                </ns1:PolicyCacheControl>
                <URC>rootLDAP</URC>
        </J2EEConfig>
</AdapterConfigs>

PolicyCacheControl and PolicyCache are indeed defined in "assureservices", while all of the other types are defined in "assureaccess".

By trial and error, I found that removing the "ns1:" specifiers allows the document to parse, but I'm fairly sure this is not actually valid.

I've seen variants on this question in the mailing list archives, but never the answer.  Can someone point me in the right direction or is this a known bug?

Thanks,
Ryan Eberhard



Reply via email to