Hi folks, Hope this topic will be read. I'm getting a problem using newIstance of SchemaTypeLoader.
Here is my code: <code> SchemaTypeLoader stl = XmlBeans.typeLoaderUnion( new SchemaTypeLoader[] { x.y.MyPrefixEventNameDocument.type.getTypeSystem(), XmlBeans.getContextTypeLoader()} ) ; SchemaType st = stl.findDocumentType(new QName("","EventName","MyPrefix")); //I don't use namespace EventName evt = (MyPrefixEventNameDocument)stl.newInstance(st, null); </code> The problem is that I have another class a.b.AnotherPrefixEventNameDocument (same root element in 2 XML buffers), so I'm getting this exception: java.lang.ClassCastException: a.b.impl.AnotherPrefixEventNameDocumentImpl Can you help please?? (I'd like to avoid using namespaces if possible :) ) Said -- View this message in context: http://www.nabble.com/ClassCastException%3A-Problem-when-creating-a-new-instance-tp24955579p24955579.html Sent from the Xml Beans - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org