1 Reply Latest reply on Dec 5, 2003 3:48 AM by Jon Barnett

    Deploying a war file with Tomcat 5 and JBoss

    Chris Newbie

      I'm running JBoss 3.2.3 and Tomcat 5.0.16 so I can use JSP 2.0. Everything starts up without error.

      I created a simple home.war file and its deployed without error but I'm not able to access the jsp correctly.

      when I go to http://127.0.0.1/home all I get is: Directory Listing For /

      If I follow the directoy listing to where the jsp file is it will display. For example: http://127.0.0.1/home/root/Desktop/home.war/home/

      I would like to have the JSP file to be root but at root all I get is a 'Welcome to JBoss' screen.

      How can I deploy my .war file as root without needing the directory structure?

      Thank you
      Chris s. Raver

      Here are the messages when the file is deployed.

      15:24:27,919 INFO [MainDeployer] Starting deployment of package: file:/jboss/server/default/deploy/home.war
      15:24:28,026 INFO [Tomcat5] deploy, ctxPath=/home, warUrl=file:/jboss/server/default/tmp/deploy/tmp11034home.war/
      15:24:29,429 INFO [ContextConfig] Missing application web.xml, using defaults only StandardEngine[jboss.web].StandardHost[localhost].StandardContext[/home]
      15:24:29,889 INFO [MainDeployer] Deployed package: file:/jboss/server/default/deploy/home.war

      My web.xml file was generated automaticly using JDeveloper.

      <?xml version = '1.0' encoding = 'windows-1252'?>
      <!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>
      Empty web.xml file for Web Application
      <session-config>
      <session-timeout>30</session-timeout>
      </session-config>
      <mime-mapping>
      html
      <mime-type>text/html</mime-type>
      </mime-mapping>
      <mime-mapping>
      txt
      <mime-type>text/plain</mime-type>
      </mime-mapping>
      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>index.html</welcome-file>
      </welcome-file-list>
      </web-app>

        • 1. Re: Deploying a war file with Tomcat 5 and JBoss
          Jon Barnett Master

          You need to create a root context by adding a jboss-web.xml to your WAR - it goes in the WEB-INF directory with your existing web.xml file.

          The jboss-web.xml should contain the following:

          <jboss-web>
           <context-root>/</context-root>
           <virtual-host>www.acme.com</virtual-host>
          </jboss-web>

          I would have thought that by default Tomcat would provide services at port 8080 - unless you have changed things.

          So access would be http://localhost:8080/home or http://127.0.0.1:8080/home, assuming that you have an index.html or index.jsp in the root directory of your WAR. However, you report that you get the root display so I am confused about your actual configuration.

          Also, your deployment indicates it can't locate the web.xml - it is in WEB-INF/web.xml of your WAR? Case is important so check the WAR with jar tvf home.war and make sure the WEB-INF directory exists, not web-inf or Web-inf or any other variations.

          You may also need to remove any existing web application mapped to the root context - e.g. Whatever one shows the Welcome to JBoss screen. I haven't downloaded 3.2.3 as yet so I can't comment on how things may have changed for this.