Also, are SDOUtil.registerStaticTypes and XMLHelper.INSTANCE.load called on the same Thread? If yes, any call to Thread#setContextClassLoader between them? ClassLoader plays an important role during types registrations such as registerStaticTypes and queries such as load.
On 1/26/07, kelvin goodson <[EMAIL PROTECTED]> wrote:
Alexander, on the face of it what you are doing seems fine, but the symptom seems to suggest that the metadata for the incoming instance document can't be found. Are you sure that the type of the root element of the instance document correctly references a type in the namespace of the registered factory? Regards, kelvin. On 26/01/07, Pankov, Alexander <[EMAIL PROTECTED]> wrote: > > Greetings all, > > I am relatively new to Tuscany SDO implementation but I am happy to see > full featured SDO. > In my case I have generated interfaces from xsd and I am trying to get > instances of those using XMLHelper and parsing xml document. I am using > the M2 jars and the code looks similar to: > > DataObjectUtil.initRuntime(); > SDOUtil.registerStaticTypes(XXXFactory.class); > XXX inst = (XXX)XMLHelper.INSTANCE.load(new > FileInputStream(path_to_schemaInstance_xml_doc)).getRootObject(); > > Here I get ClassCastException that AnyTypeDataObject can not be casted. > Is what I'm trying to do possible at all? If yes what am I doing wrong > and if the answer is no what is the recommended way of getting such > instances from xml documents? Is it a DAS responsibility? > > It is pretty urgent to answer these questions so please drop any ideas > that come to mind. > > Best Regards, > Alexander > >
-- Yang ZHONG
