6 Replies Latest reply on Apr 13, 2012 8:27 PM by raylite3

    Purposes of the different descriptor files

    mistysj

      I apologize in advance if this is not a great question, but I'm having a hard time finding a definitive answer. I need to know what the difference is between these different files:

      • ejb-jar.xml
      • web.xml
      • jboss-web.xml
      • jboss.xml

       

      Here is what I think after reading, but I'm sure I've got some of it wrong.

       

      • ejb-jar.xml - Contains settings specifically for EJBs
      • web.xml - Contains constraints for the HTTP protocol and web resources, and web-based login information. Also contains other requirements of the application, such as a specific name of a datasource or security domain that needs to exist before the app will run. (???)
      • jboss-web.xml - Contains resources that fill requirements set in the web.xml, and contains JBoss-specific settings
      • jboss.xml - JBoss-specific metadata, such as JNDI and clustering things.

       

      I'm sure it's not right, and it leaves me still unsure about the real differences between the files. Some things I've seen lead me to believe that the jboss.xml things can also be put in jboss-web.xml instead, for instance.

       

      I appreciate any help anyone can give me!

        • 1. Re: Purposes of the different descriptor files
          mistysj

          I have found out some more info. It looks like (please correct me if I'm wrong):

          • jboss.xml extends ejb-jar.xml with JBoss-specific metadata
          • jboss-web.xml extends web.xml with JBoss-specific metadata
          • 2. Re: Purposes of the different descriptor files
            mcasperson

            Vendor-Specific Deployment Information

            The J2EE platform specification defines deployment unit requirements for each of the four J2EE module types and for a J2EE application itself. Each specification defines how the archive file must be structured to operate correctly with a J2EE deployment tool. In addition to application code and a deployment descriptor, an application requires a certain amount of additional vendor- or environment-specific binding information.

             

            What is the ejb-jar.xml File?

            The ejb-jar.xml file is an EJB deployment descriptor file, and, when used, it describes the following:

            • mandatory structural information about all included enterprise beans;
            • a descriptor for container managed relationships, if any;
            • an optional name of an ejb-client-jar file for the ejb-jar;
            • an optional application-assembly descriptor.

             

            Get Started with JBoss Application Server

            • ejb-jar.xml - This is the standard EJB deployment descriptor, declaring the available enterprise beans, their logical names, interfaces, and other deployment properties (security, transactions, etc.). For a look at a sample ejb-jar.xml file, click here.
            • jboss.xml - This optional file is used to specify a different JNDI name for a bean's home interface. The default JNDI name for a bean is the ejb-jar.xml ejb-name element value.

             

            web.xml file

            The web.xml file provides configuration and deployment information for the Web components that comprise a Web application.

             

            What is the jboss-web.xml file?

            To deploy your web application, you have to specify (nearly) everything about its setup using the standard web.xml descriptor. This file is bundled in the war archive in the WEB-INF directory. The content and syntax of this file in specified in the servlet2.2 specification.

             

            An important point is that the specification does not allow you to add vendor-specific configuration in this file. While the web.xml is sufficient for most applications, there may be cases where you want to add JBoss-specific information in your deployment descriptor. This can be done by providing another file named jboss-web.xml in the WEB-INF directory.

             

            What is an ias-web.xml deployment descriptor file?

            This comes from the fact that the JavaEE standard specifies a lot, but still leaves room for vendor specific enhancements. And those enhancements are controlled by the vendor-speficic descriptors. The counterpart of ias-web.xml on JBoss would for example be jboss-web.xml

             

            Deployment Descriptors (not directly related to jboss-web.xml, but shows how name-web.xml files are used in other application servers)

            For example, the web.xml file is a standard Java EE deployment descriptor, specified in the Java Servlet specification, but the sun-web.xml file contains configuration data specific to the Sun GlassFish Enterprise Server implementation.[3] In addition to that there are other types of descriptors as well.

            • 3. Re: Purposes of the different descriptor files
              wdfink

              You tagged the thread with AS6 and AS7, so you should be aware that the name jboss specific descriptor change if you deploy the EAR/WAR in AS7.

              • 4. Re: Purposes of the different descriptor files
                mistysj

                Wolf-Dieter, I don't really understand what you mean. Can you point me to some docs to read about this?

                • 5. Re: Purposes of the different descriptor files
                  mistysj

                  Thanks Matt, that answers it for all of them except the jboss.xml, I think!

                  • 6. Re: Purposes of the different descriptor files
                    raylite3

                    jboss.xml has been replaced by jboss-ejb3.xml

                     

                    https://docs.jboss.org/author/display/AS71/jboss-ejb3.xml+Reference

                    1 of 1 people found this helpful