[ https://issues.apache.org/jira/browse/XMLBEANS-356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580599#action_12580599 ]
pki15 edited comment on XMLBEANS-356 at 3/19/08 3:58 PM: ------------------------------------------------------------------- I'm having the same issue. The fix from a schema point of view (in your TestSchema.xsd example above) is to alter the NameElement from complexContent to simpleContent, leaving it as a complexType is fine. That is, change <xs:element name="NameElement"> <xs:annotation> <xs:documentation>Data associated with the Administrative Area. e.g. Full name of administrative area or part of it. eg. MI in USA, NSW in Australia, reference location to the administrative area</xs:documentation> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="NameType"/> </xs:complexContent> </xs:complexType> </xs:element> to <xs:element name="NameElement"> <xs:annotation> <xs:documentation>Data associated with the Administrative Area. e.g. Full name of administrative area or part of it. eg. MI in USA, NSW in Australia, reference location to the administrative area</xs:documentation> </xs:annotation> <xs:complexType> <xs:simpleContent> <xs:extension base="NameType"/> </xs:simpleContent> </xs:complexType> </xs:element> This is fine if you have control of the schema but unfortunately I am being given a schema from a third party for a web service and hence have to negotiate the schema change. was (Author: pki15): I'm having the same issue. The fix from a schema point of view (in your TestSchema.xsd example above) is to alter the NameElement from complexContent to simpleContent, leaving it as a complexType is fine. That is, change <code> <xs:element name="NameElement"> <xs:annotation> <xs:documentation>Data associated with the Administrative Area. e.g. Full name of administrative area or part of it. eg. MI in USA, NSW in Australia, reference location to the administrative area</xs:documentation> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="NameType"/> </xs:complexContent> </xs:complexType> </xs:element> </code> to <xs:element name="NameElement"> <xs:annotation> <xs:documentation>Data associated with the Administrative Area. e.g. Full name of administrative area or part of it. eg. MI in USA, NSW in Australia, reference location to the administrative area</xs:documentation> </xs:annotation> <xs:complexType> <xs:simpleContent> <xs:extension base="NameType"/> </xs:simpleContent> </xs:complexType> </xs:element> This is fine if you have control of the schema but unfortunately I am being given a schema from a third party for a web service and hence have to negotiate the schema change. > xception in thread "main" org.apache.xmlbeans.SchemaTypeLoaderException: > Simple type does not have a recognized variety > (schemaorg_apache_xmlbeans.system.sF1DBD93096C623A6A85C0BCA912AE262.nameelementd068elemtype) > - code 8 > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: XMLBEANS-356 > URL: https://issues.apache.org/jira/browse/XMLBEANS-356 > Project: XMLBeans > Issue Type: Bug > Affects Versions: Version 2.3 > Reporter: Alex Rykov > Attachments: TestSchema.xsd, XBeanTest.java > > > Attached schema compiles fine. However, when trying to create the top level > element in the document the following exception occurs: > Exception in thread "main" org.apache.xmlbeans.SchemaTypeLoaderException: > Simple type does not have a recognized variety > (schemaorg_apache_xmlbeans.system.sF1DBD93096C623A6A85C0BCA912AE262.nameelementd068elemtype) > - code 8 > at > org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.finishLoadingType(SchemaTypeSystemImpl.java:2659) > at > org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.resolveHandle(SchemaTypeSystemImpl.java:3507) > at > org.apache.xmlbeans.SchemaComponent$Ref.getComponent(SchemaComponent.java:104) > at org.apache.xmlbeans.SchemaType$Ref.get(SchemaType.java:872) > at > org.apache.xmlbeans.impl.schema.SchemaPropertyImpl.getType(SchemaPropertyImpl.java:92) > at > org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createElementType(SchemaTypeImpl.java:965) > at > org.apache.xmlbeans.impl.values.XmlObjectBase.create_element_user(XmlObjectBase.java:893) > at org.apache.xmlbeans.impl.store.Xobj.getUser(Xobj.java:1657) > at org.apache.xmlbeans.impl.store.Cur.getUser(Cur.java:2654) > at org.apache.xmlbeans.impl.store.Xobj.insertElement(Xobj.java:2099) > at org.apache.xmlbeans.impl.store.Xobj.add_element_user(Xobj.java:2179) > at schema.impl.NameElementDocumentImpl.addNewNameElement(Unknown Source) > at test.XBeanTest.main(XBeanTest.java:13) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]