8 Replies Latest reply on May 13, 2009 4:01 PM by wolfgangknauf

    jboss_5_0.xsd: jboss version attribute

    aloubyansky

      What is version attribute supposed to indicate? EJB spec version?

      At the moment, in jboss_5_0.xsd its value is fixed and is 3.0. Everything else appearing in XML is invalid. In our tests though, some jboss.xml files have it set to 5.0, some 3.0.

      <jboss xmlns="http://www.jboss.com/xml/ns/javaee"
       xmlns:jee="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
       version="5.0">
      
      <jboss
       xmlns="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
       http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
       version="3.0">
      


        • 1. Re: jboss_5_0.xsd: jboss version attribute
          aloubyansky

          Ok, I should have read the comments in the XSD before posting, it's actually the EJB spec.

          Are you sure the value should be fixed here?

          • 2. Re: jboss_5_0.xsd: jboss version attribute
            wolfc

            For now only fix stuff that is causing tests to fail. Make a Jira to fix it properly after we have a fully working testsuite.

            • 3. Re: jboss_5_0.xsd: jboss version attribute
              aloubyansky

              Ok, let's revisit version attribute again. In jboss_5_0.xsd it is documented as the ejb spec version. But in case of DTD, it's the DTD version (from JBossMetaData):

              /**
               * Callback for the DTD information
               */
               @XmlTransient
               public void setDTD(String root, String publicId, String systemId)
               {
               this.dtdPublicId = publicId;
               this.dtdSystemId = systemId;
               // Set the version based on the public id
               if (dtdPublicId != null && dtdPublicId.contains("3.0"))
               setVersion("3.0");
               if (dtdPublicId != null && dtdPublicId.contains("3.2"))
               setVersion("3.2");
               if (dtdPublicId != null && dtdPublicId.contains("4.0"))
               setVersion("4.0");
               if (dtdPublicId != null && dtdPublicId.contains("4.2"))
               setVersion("4.2");
               if (dtdPublicId != null && dtdPublicId.contains("5.0"))
               setVersion("5.0");
               }


              In addition to version property, JBossMetaData has ejbVersion property, which is transient though and is set only by JBoss50Creator:
              protected JBoss50MetaData create()
               {
               JBoss50MetaData metaData = new JBoss50MetaData();
               metaData.setVersion("3.0");
               metaData.setEjbVersion("3.0");
               return metaData;
               }


              So, what the version attribute should indicate after all?
              What if we follow the DTD logic for version and if necessary bind ejbVersion to an attribute (ejb-version) instead?

              • 4. Re: jboss_5_0.xsd: jboss version attribute
                aloubyansky

                Coming back to this issue. I am going to make the JBossMetaData.getVersion() return the version of the schema, not the EJB version. There is an attribute (@XmlTransient) ejbVersion which returns the EJB spec version. It is currently set during EjbJar and JBoss metadata merge and in JBoss50Creator. If there needs to be a schema element or attribute to specify the EJB spec version in the JBoss descriptor or annotation then please open a Jira issue. Thanks.

                • 5. Re: jboss_5_0.xsd: jboss version attribute
                  wolfc

                  I don't get that last bit. getEjbVersion() is returning the EJB spec version, right?
                  Then that should be reflected in the xsd.

                  I agree that version should be controlled by jboss-metadata. I'm not so sure whether it should reflect the AS version though, because we're going to use the same thing in Embedded and Reloaded.

                  • 6. Re: jboss_5_0.xsd: jboss version attribute
                    aloubyansky

                    getEjbVersion() returns the EJB spec version - right. But there is no xsd component in jboss schema for it. The value is set to the EJB version from the ejb-jar.xml and/or JBoss50Creator (at the initialization).

                    Version attribute reflects not the AS version but the schema version of the deployment descriptor. Although, I don't see where it is actually used.

                    • 7. Re: jboss_5_0.xsd: jboss version attribute
                      wolfgangknauf

                      Any news on this? 5.0.1GA still contains the broken jboss_5.0.xsd.

                      See also https://jira.jboss.org/jira/browse/JBAS-6426

                      Thanks

                      Wolfgang

                      • 8. Re: jboss_5_0.xsd: jboss version attribute
                        wolfgangknauf

                        This change was not published to http://www.jboss.org/j2ee/schema up to now, and it is not in JBoss 5.1.0CR1. Will this be handled soon?

                        See also https://jira.jboss.org/jira/browse/JBMETA-200 for some more problems in jboss_5_1.xsd

                        Wolfgang