4 Replies Latest reply on Jul 1, 2009 9:21 AM by dmlloyd

    More trouble in the bean-deployer schema

    dmlloyd

      The following construct doesn't validate, even though it's allowed by the bean deployer (which fortunately doesn't validate, but that's another thread):

       ...
       <parameter class="...">
       <bean name="..." class="...">
       ...
       </bean>
       </parameter>
       ...
      


      The error is something like this (formatted for readability):

      Error:Error:line (15)cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'.
      One of
       '{"urn:jboss:bean-deployer:2.0":value,
       "urn:jboss:bean-deployer:2.0":inject,
       "urn:jboss:bean-deployer:2.0":value-factory,
       "urn:jboss:bean-deployer:2.0":collection,
       "urn:jboss:bean-deployer:2.0":list,
       "urn:jboss:bean-deployer:2.0":set,
       "urn:jboss:bean-deployer:2.0":array,
       "urn:jboss:bean-deployer:2.0":map,
       "urn:jboss:bean-deployer:2.0":null,
       "urn:jboss:bean-deployer:2.0":this,
       WC[##other:"urn:jboss:bean-deployer:2.0"],
       "urn:jboss:bean-deployer:2.0":annotation}'
      is expected.
      


      The xsd for bean-deployer is a bit too crazy for me to parse mentally, so I don't know what the problem is.

      Also, the following validation errors have been popping up lately:

      /home/david/src/java/microcontainer/trunk/kernel/src/main/resources/schema/bean-deployer_2_0.xsd
       Error:Error:line (139)rcase-RecurseLax.2: There is not a complete functional mapping between the particles.
       Error:Error:line (139)src-redefine.6.2.2: Group 'valueGroup' does not properly restrict the group it redefines; constraint violated: 'rcase-RecurseLax.2'.
      


        • 1. Re: More trouble in the bean-deployer schema
          aloubyansky

          The parsing error seems to be clear enough? There is no bean in the schema type for parameter, hence it can't appear there.

          As to the schema validation errors, the group appears to be not properly redefined. The way it's redefined is supposed to be a restriction, i.e. you should list a subset of the elements/groups of the group you are redefining.
          If you want extension, you should reference the group you are redefining in the new group and add the elements you want.
          Looking at the schemas, the groups are identical in both schemas (with bean element commented out, btw). So, you can just remove the group as a child of redefine.

          • 2. Re: More trouble in the bean-deployer schema
            dmlloyd

             

            "alex.loubyansky@jboss.com" wrote:
            The parsing error seems to be clear enough? There is no bean in the schema type for parameter, hence it can't appear there.


            My point is, perhaps there should be. I believe that "bean" corresponds to BeanMetaData, which extends ValueMetaData, thus is should be usable anywhere a "value" is usable.

            "alex.loubyansky@jboss.com" wrote:
            As to the schema validation errors, the group appears to be not properly redefined. The way it's redefined is supposed to be a restriction, i.e. you should list a subset of the elements/groups of the group you are redefining.
            If you want extension, you should reference the group you are redefining in the new group and add the elements you want.
            Looking at the schemas, the groups are identical in both schemas (with bean element commented out, btw). So, you can just remove the group as a child of redefine.


            Hm. Maybe I'll have a look at that when I get time...

            • 3. Re: More trouble in the bean-deployer schema
              wolfgangknauf

              The validation error is also in JIRA as part of https://jira.jboss.org/jira/browse/JBMICROCONT-446

              Wolfgang

              • 4. Re: More trouble in the bean-deployer schema
                dmlloyd

                I added a comment to that issue.