3 Replies Latest reply on Jul 16, 2004 2:43 PM by bommee

    default context no longer works on 3.2.3

    kenroberts

      Hi folks.

      I'm trying to upgrade from JBoss 3.0.6 to 3.2.3.

      I have a project that would take the default context before (http://localhost:8080) before, and it no longer does that. I would really like to know how to set the default context in a way that 3.2.3 would accept.

      Here's the web.xml that works on 3.0.6 but not 3.2.3:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
      <web-app>
      <!--distributable/-->

      <servlet-name>Warmonger</servlet-name>
      <servlet-class>com.nineci.webapp.Warmonger</servlet-class>

      <servlet-mapping>
      <servlet-name>Warmonger</servlet-name>
      <url-pattern>/war</url-pattern>
      </servlet-mapping>
      <session-config>
      <session-timeout>30</session-timeout>
      </session-config>
      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      </welcome-file-list>
      </web-app>

      When you go to http://localhost:8080, the welcome file described in this document is used, which redirects me to my /war mapping.

      Can someone explain why this no longer works, and better yet how to accomplish the same aim?

      Thanks.

        • 1. Re: default context no longer works on 3.2.3
          raja05

          Im not sure how it works on 3.0.6 as i have 3.0.8 and i could get it only as
          http://localhost:8080/warname
          One thing you can try to do to accomplish what you need is to package it into a ear and specify your context-root to be a / in ur application.xml
          Or if you dont want to repackage into a ear, create a jboss-web.xml which would have a
          context-root tag that has a value of /

          Lookup the dtd for jboss-web_3_2.dtd to figure the Definition of context-root
          http://www.jboss.org/j2ee/dtd/

          • 2. Re: default context no longer works on 3.2.3
            kenroberts

            Thanks.

            I'll give that a try and then post back.

            • 3. Re: default context no longer works on 3.2.3
              bommee

              Thanks raja05!

              I have spent too much time trying to find something on the

              No Default Context
              issue and this is all I needed to know.

              So to paraphrase:

              In your web applications WEB_INF directory if the jboss-web.xml file doesn't already exist you will need to create it. This file will contain at least:
              <jboss-web>
               <context-root>/</context-root>
              </jboss-web>
              


              And that should be all you need to set this as the default context. Man that was painful, maybe I just had really bad luck, but there doesn't seem to be any docs on this.

              Thanks again.