5 Replies Latest reply on Jul 15, 2009 1:41 PM by aloubyansky

    @XmlType.propOrder required with no schema sequence

    thomas.diesler

       

      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Property order is not specified for type org.jboss.osgi.blueprint.parser.xb.TRegistrationListener bound to a sequence. Property order can be specified using @XmlType.propOrder or @XmlAccessorOrder. List of properties: ref refFIXME bean any unregistrationMethod registrationMethod reference
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.assertPropOrderNotRequired(JBossXBNoSchemaBuilder.java:1278)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateType(JBossXBNoSchemaBuilder.java:1071)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:779)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:767)
      


      The schema is here

      http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint.xsd

        • 1. Re: @XmlType.propOrder required even if schema does not defi
          thomas.diesler

           

           <xsd:complexType name="TregistrationListener">
           <xsd:annotation>
           <xsd:documentation>
           <![CDATA[
           A registration listener definition. The target registration listener
           can be either a <ref> to a <bean> or <service> component, or an inline
           <bean> or <service> component definition. The registration-method and
           unregistration-method attributes define the methods that will be called
           for the respective events.
          
           For the very common case of using a <ref> to a listener component, the
           ref attribute may also be used as a shortcut.
           ]]>
           </xsd:documentation>
           </xsd:annotation>
           <xsd:group ref="targetComponent" />
           <xsd:attribute name="ref" type="Tidref" use="optional" />
           <!-- ### why are there both required? -->
           <xsd:attribute name="registration-method" type="Tmethod" use="required" />
           <xsd:attribute name="unregistration-method" type="Tmethod" use="required" />
           </xsd:complexType>
          


           <xsd:group name="targetComponent">
           <xsd:annotation>
           <xsd:documentation>
           <![CDATA[
           A targetcomponent is one that can be a target for a
           listener, registration-listener, or type-converter element.
           This is used in contexts where the requirement is a single
           provided object that will implement a particular interface.
           The provided object is obtained either from a <ref> element
           or inline (<bean> or <reference>).
           ]]>
           </xsd:documentation>
           </xsd:annotation>
           <xsd:choice>
           <xsd:element name="bean" type="Tbean" />
           <xsd:element name="reference" type="Treference" />
           <xsd:element name="ref" type="Tref" />
           <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
           </xsd:choice>
           </xsd:group>
          


          • 2. Re: @XmlType.propOrder required with no schema sequence
            thomas.diesler
            • 3. Re: @XmlType.propOrder required with no schema sequence
              aloubyansky

              Again, XSD is irrelevant here since binding is based on Java annotations. That means you have to bind the type to a choice with annotations.
              I can't see the class at the moment, i.e. svn.jboss.com is not accessible. To bind to a choice you have to annotate a class with e.g.

              @JBossXmlModelGroup(name="pc", kind=JBossXmlConstants.MODEL_GROUP_CHOICE)

              Sequence is the default.

              • 4. Re: @XmlType.propOrder required with no schema sequence
                thomas.diesler

                you might be pleased to hear that I successfully moved BP parsing to XB annotations ;-)

                • 5. Re: @XmlType.propOrder required with no schema sequence
                  aloubyansky

                  Yeaaah... Say it again...