4 Replies Latest reply on Jan 20, 2010 11:10 PM by jaikiran pai

    Deployment problem

    Andrig Miller Apprentice

      I have a very simple EAR, and according to my understanding of EE 5, I know longer need web.xml, or application.xml, or the META-INF directories, etc.  I can simply have my EJB's in a jar, and servlet class in a war, all packaged in an EAR.


      My EAR looks like the following:





      The StatelessInVMEJB.jar has the following contents:





      The StatelessInVMWeb.war has the following contents:




      The Stateless session bean deploys fine, but with the servlet I get the following:


      14:59:50,232 INFO  [TomcatDeployment] deploy, ctxPath=/StatelessInVMWeb
      14:59:50,291 WARNING [config] Unable to process deployment descriptor for context '/StatelessInVMWeb'


      The admin console shows everything as okay, but when I try to hit the servlet in the browser I get the following:


      The requested resource /StatelessInVMWeb is not available.


      This should work, and I shouldn't need a web.xml or an application.xml anymore.

        • 1. Re: Deployment problem
          Brian Stansberry Master

          My reading EE.8.4.2 paragraph 3 tells me that support for servlets in a war without a web.xml is not required by EE 5. That's because there are no annotations in EE 5/Servlet 2.5 that can be applied to servlet classes to provide the necessary deployment descriptor data (@WebServlet et al are EE 6/Servlet 3.0).


          If the module deployment descriptor is absent, or is present and is a Java EE 5
          version descriptor and the metadata-complete attribute is not set to true, the
          deployment tool must examine all the class files in the application package that
          can be used by the module .... Any annotations that specify deployment
          information must be logically merged with the information in the deployment
          descriptor (if present).


          A war containing only jsp's should work though (should in the sense of what the spec says). See war example in "Enterprise Application Development Made Easy" at http://java.sun.com/developer/technicalArticles/J2EE/intro_ee5/


          The WARNING in the log seems wrong.

          • 2. Re: Deployment problem
            Andrig Miller Apprentice
            Well, just for reference I did get it to work.  I added a META-INF directory at the EAR level, and added an application.xml file.  Now it deploys just fine, and works.  I'm confused as to why Sun tutorial on EE 5 specifies that an EAR file doesn't require this.  I also did find that the web.xml file is required when there is a servlet, but I had to get that from the specification document itself.  Well, I guess I shouldn't trust the tutorial .
            • 3. Re: Deployment problem
              Brian Stansberry Master

              Per EE8.4.2 paragraph 1, you shouldn't need an application.xml for an ear:


              The deployment tool must first read the Java EE application deployment de-
              scriptor from the application .ear file (META-INF/application.xml). If the de-
              ployment descriptor is present, it fully specifies the modules included in the
              application. If no deployment descriptor is present, the deployment tool uses
              the following rules to determine the modules included in the application.


              Goes on with simple obvious rules like files ending in .war are web modules etc.

              • 4. Re: Deployment problem
                jaikiran pai Master

                Which version of JBoss AS is this? I sort of remember that i was able to get an application running without the application.xml. I don't however remember whether it had a META-INF folder in it. I'll try that today.


                By the way, does the name of the ear end with the .ear? If not, probably the MC isn't able to identify this as a EAR deployment without the META-INF folder.