2 Replies Latest reply on Oct 2, 2012 2:28 PM by vamsi2012

    Error trying to Validate jboss-ejb3.xml

    vamsi2012

      In the Jboss-ejb3.xml,its trying to reference http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd  something like this.

      In the above,We are referencing both Schemas http://www.jboss.com/xml/ns/javaee jboss-ejb3-2_0.xsd (namespace is http://www.jboss.com/xml/ns/javaee ) and http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd (namespace is http://java.sun.com/xml/ns/javaee) under xsi:schemaLocation. jboss-ejb3-2_0.xsd  inturn references jboss-ejb3-spec-2_0.xsd something like this  

       

        There  is an ambiguity error or the Conflict that is Caused for  the Element in both jboss-ejb3-spec-2_0.xsd and ejb-jar_3_1.xsd 1. jboss-ejb3-spec-2_0.xsd  Defines the Defines the Element as below:  

       

                                                                                                                It references assembly-descriptor like this:                                                                                                 2. http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd  Defines the Element   something like this                   The assembly-descriptorType defines         application-assembly information.                 The application-assembly information consists of the         following parts: the definition of security roles, the         definition of method permissions, the definition of         transaction attributes for enterprise beans with         container-managed transaction demarcation, the definition         of interceptor bindings, a list of         methods to be excluded from being invoked, and a list of         exception types that should be treated as application exceptions.                 All the parts are optional in the sense that they are         omitted if the lists represented by them are empty.                 Providing an assembly-descriptor in the deployment         descriptor is optional for the ejb-jar or .war file producer.                                                                           Because of the above Scenario when I am trying to Validate the XML ,I am getting the following error: cos-nonambig: "http://java.sun.com/xml/ns/javaee":assembly-descriptor and "http://java.sun.com/xml/ns/javaee":assembly-descriptor (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles. Attached are the 3 XSD Files. Could anyone help me resolve this.

        • 1. Re: Error trying to Validate jboss-ejb3.xml
          vamsi2012

          Here is my Question:

          In the Jboss-ejb3.xml,its trying to reference http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd   something like this.

           

          <?xml version="1.0" encoding="UTF-8"?>

          <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"              

                         xmlns="http://java.sun.com/xml/ns/javaee"              

                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              

                         xmlns:c="urn:clustering:1.0"              

                         xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee jboss-ejb3-2_0.xsd http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"               version="3.1"               impl-version="2.0">

           

           

          In the above,We are referencing both Schemas

          http://www.jboss.com/xml/ns/javaee jboss-ejb3-2_0.xsd (namespace is http://www.jboss.com/xml/ns/javaee ) and

          http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd (namespace is http://java.sun.com/xml/ns/javaee) under xsi:schemaLocation.

           

          jboss-ejb3-2_0.xsd  inturn references jboss-ejb3-spec-2_0.xsd something like this

           

          <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

                     targetNamespace="http://www.jboss.com/xml/ns/javaee"

                     xmlns="http://www.jboss.com/xml/ns/javaee"

                     xmlns:javaee="http://java.sun.com/xml/ns/javaee"

                     elementFormDefault="qualified"

                     attributeFormDefault="unqualified"

                     version="2.0">

             <!-- xs:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="ejb-jar_3_1.xsd"/ -->

             <!-- xs:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"/ -->

             <xs:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="jboss-ejb3-spec-2_0.xsd"/>

           

           

           

          There  is an ambiguity error or the Conflict that is Caused for  the Element <assembly-descriptorType> in both jboss-ejb3-spec-2_0.xsd and ejb-jar_3_1.xsd

           

           

          1.

          jboss-ejb3-spec-2_0.xsd  Defines the Defines the Element <assembly-descriptorType> as below:

           

           

          <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

                     targetNamespace="http://java.sun.com/xml/ns/javaee"

                     xmlns:javaee="http://java.sun.com/xml/ns/javaee"

                     xmlns:jboss="http://www.jboss.com/xml/ns/javaee"

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee jboss-ejb3-2_0.xsd"

                     elementFormDefault="qualified"

                     attributeFormDefault="unqualified"

                     version="2.0">

           

             <!-- xs:include schemaLocation="ejb-jar_3_1.xsd"/ -->

             <!--

             <xs:include schemaLocation="http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"/>

             -->

           

             <xs:import namespace="http://www.jboss.com/xml/ns/javaee" schemaLocation="jboss-ejb3-2_0.xsd"/>

           

              <xs:redefine schemaLocation="http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">

                <xs:complexType name="assembly-descriptorType">

                   <xs:complexContent>

                      <xs:extension base="javaee:assembly-descriptorType">

                         <xs:sequence>

                            <xs:element ref="javaee:assembly-descriptor-entry" minOccurs="0" maxOccurs="unbounded"/>

                         </xs:sequence>

                      </xs:extension>

                   </xs:complexContent>

                </xs:complexType>

             </xs:redefine>

           

           

          It references assembly-descriptor like this:

          <xs:complexType name="jboss-ejb-jarType">

                <xs:complexContent>

                   <xs:extension base="javaee:ejb-jarType">

                      <xs:sequence>

                         <xs:element ref="jboss:enterprise-beans" minOccurs="0"/>

                         <xs:element name="assembly-descriptor"  type="javaee:assembly-descriptorType" minOccurs="0"/>

                         </xs:sequence>

                      <xs:attribute name="impl-version" type="javaee:dewey-versionType" fixed="2.0" use="required"/>

                   </xs:extension>

                </xs:complexContent>

             </xs:complexType>

           

           

           

           

           

           

          2.

          http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd   Defines the Element <assembly-descriptorType>   something like this

           

           

           

          <xsd:complexType name="assembly-descriptorType">

              <xsd:annotation>

                <xsd:documentation>

           

                  The assembly-descriptorType defines

                  application-assembly information.

                 

                  The application-assembly information consists of the

                  following parts: the definition of security roles, the

                  definition of method permissions, the definition of

                  transaction attributes for enterprise beans with

                  container-managed transaction demarcation, the definition

                  of interceptor bindings, a list of

                  methods to be excluded from being invoked, and a list of

                  exception types that should be treated as application exceptions.

                 

                  All the parts are optional in the sense that they are

                  omitted if the lists represented by them are empty.

                 

                  Providing an assembly-descriptor in the deployment

                  descriptor is optional for the ejb-jar or .war file producer.

                 

               </xsd:documentation>

              </xsd:annotation>

              <xsd:sequence>

                <xsd:element name="security-role"

                             type="javaee:security-roleType"

                             minOccurs="0"

                             maxOccurs="unbounded"/>

                <xsd:element name="method-permission"

                             type="javaee:method-permissionType"

                             minOccurs="0"

                             maxOccurs="unbounded"/>

                <xsd:element name="container-transaction"

                             type="javaee:container-transactionType"

                             minOccurs="0"

                             maxOccurs="unbounded"/>

                <xsd:element name="interceptor-binding"

                             type="javaee:interceptor-bindingType"

                             minOccurs="0"

                            maxOccurs="unbounded"/>

                <xsd:element name="message-destination"

                             type="javaee:message-destinationType"

                             minOccurs="0"

                             maxOccurs="unbounded"/>

                <xsd:element name="exclude-list"

                             type="javaee:exclude-listType"

                             minOccurs="0"/>

                <xsd:element name="application-exception"

                             type="javaee:application-exceptionType"

                             minOccurs="0"

                             maxOccurs="unbounded"/>

             </xsd:sequence>

              <xsd:attribute name="id"

                             type="xsd:ID"/>

            </xsd:complexType>

           

           

          Because of the above Scenario when I am trying to Validate the XML ,I am getting the following error:

          cos-nonambig: "http://java.sun.com/xml/ns/javaee":assembly-descriptor and "http://java.sun.com/xml/ns/javaee":assembly-descriptor (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.

           

          Attached are the 3 XSD Files.

          Could anyone help me resolve this.

           

          • 2. Re: Error trying to Validate jboss-ejb3.xml
            vamsi2012

            Could someone help me with the above error

            Thanks

            Vam