4 Replies Latest reply on Jul 30, 2007 2:17 PM by Peter Johnson

    war file exploded in tmp folder

    mike bojarski Newbie

      Hi I am using JBoss 4.2.0GA. When i copy/paste a WAR file into the server/default/deploy directory, the JBoss server explodes it into server/default/tmp/deploy directory. When i try to access my application via web browser, it goes to the default page as specified in web.xml, but cannot seem to find any servlets that are mapped in web.xml. I get a 404 resource not found error. I am not using any jboss specific xml description files in my WEB-INF or META-INF folder within the WAR file. I am just wondering if this tmp folder where the WAR is being expanded is responsible for the servlets not being found. They are all mapped correctly in web.xml. Any help would be appreciated.

        • 1. Re: war file exploded in tmp folder
          Peter Johnson Master

          The tmp directory is just a staging area for the contents of the WAR file. The app server cannot (or doesn't want to) work with files within an archive and therefore explodes the archive so that it can access the files directly. You could deploy your app as exploded in the deploy directory and then the tmp directory is not used. See http://wiki.jboss.org/wiki/Wiki.jsp?page=ExplodedDeployment.

          The main reason for the 404 error is that the URL entered is not being mapped correctly. Could you post the contents of your web.xml file? Be sure to embed the contents within [ code ]...[ /code ] brackets (without the spaces). You can select the contents and click the 'Code' button to do this. Also, post a URL that you think should work but results on a 404 error.

          • 2. Re: war file exploded in tmp folder
            mike bojarski Newbie

             

            <?xml version='1.0' encoding='ISO-8859-1' ?>
            <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
            "http://java.sun.com/dtd/web-app_2_3.dtd">
            <web-app>
             <listener>
             <listener-class>trivia.ContextListener</listener-class>
             </listener>
             <Servlet>
             <Servlet-name>analyzeservlet</Servlet-name>
             <Servlet-class>trivia.AnalyzeServlet</Servlet-class>
             <load-on-startup>1</load-on-startup>
             </Servlet>
             <Servlet>
             <Servlet-name>controlservlet</Servlet-name>
             <Servlet-class>trivia.ControlServlet</Servlet-class>
             <load-on-startup>1</load-on-startup>
             </Servlet>
             <Servlet-mapping>
             <Servlet-name>analyzeservlet</Servlet-name>
             <url-pattern>/verify.html</url-pattern>
             </Servlet-mapping>
             <Servlet-mapping>
             <Servlet-name>controlservlet</Servlet-name>
             <url-pattern>/control.html</url-pattern>
             </Servlet-mapping>
             <welcome-file-list>
             <welcome-file>index.html</welcome-file>
             </welcome-file-list>
            </web-app>
            


            That is my web.xml file. It is correct because I have deployed the same WAR file using Tomcat and Resin and it works successfully.

            So in my index.html I have a form and action is action='control.html'

            • 3. Re: war file exploded in tmp folder
              mike bojarski Newbie

              Actually I found the problem. This was occuring because the start of my tags were capitalized i.e. <Servlet-mapping> should be <servlet-mapping>

              • 4. Re: war file exploded in tmp folder
                Peter Johnson Master

                If you change your action to action='control' and change the servlet mapping to:

                <Servlet-mapping>
                 <Servlet-name>controlservlet</Servlet-name>
                 <url-pattern>/control</url-pattern>
                </Servlet-mapping>


                does it work? I am suspecting that the .html suffix is messing it up.