3 Replies Latest reply on Nov 5, 2004 4:13 PM by namitajain

    Problem with webapp deploy as "/" context

    nixnixnix

      Using the JBoss doucmentation it says to deploy a webapp on the root ("/") context, you can wrap your WAR in an EAR, which I did, the application.xml like so:

      <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>


      <display-name>My Fine App</display-name>

      foo.jar



      <web-uri>app.war</web-uri>
      <context-root>/</context-root>





      The app deploys just fine, but it gets deployed as:

      http://www.xxx.com/app

      not

      http://www.xxx.com/

      What's the problem?

        • 1. Re: Problem with webapp deploy as "/" context
          nixnixnix

          I figured this out by accident: I read the SOURCE CODE.

          It's not in the paid-for documentation :\

          The trick is to deploy the app exactly like I did, except you MUST name the war archive ROOT.war, therefore it would look like this:

          <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>


          <display-name>My Fine App</display-name>

          foo.jar



          <web-uri>ROOT.war</web-uri>
          <context-root>/</context-root>




          While not exactly a bug (that's debatable), this is kinda silly: why can't I name it the way I want and ALWAYS deploy it wherever I want?

          Furthermore, I cannot find any decent documentation or any examples of a jboss-web.xml file. The paid-for documentation has pictures of the DTD and one small fragment that has only <resource-refs> in it, otherwise, nothing.

          • 2. Re: Problem with webapp deploy as "/" context
            twutort

            I'm have a problem that is sort of similar to this. My includes in my jsps require me to put wwwroot on the relative path if the context is set to /. Fore example:


            <web-uri>ROOT.war</web-uri>
            <context-root>/</context-root>


            My jsp looks like this:

            <%@ include file="/wwwroot/includes_jsp/ADMIN/sniffer.shtml" %>

            Is there any setting you know of that I can use so I do not have to have the wwwroot in all my paths?

            Tim

            • 3. How to deploy web apps in Production env. in JBoss-3.2.5
              namitajain

              Hi,
              I would like to know how to set up virtual hosts in jboss 3.2.5 in my production box running jboss-3.2.5/Tomcat 5.x using MySql 4.0 on Linux O.S.

              I have more than one web application developed using JSP/Servlets and packaged as .ear files. I have domain names set up as myapp1.com and myapp2.com, for eg.,
              and want to acces my web apps as http://myapp1.com and http://myapp2.com without specifying the context root String name for each, such as http://localhost:8080/myapp1 or http://localhost:8080/myapp2,

              How can I set up the context root in each of the application.xml / jboss-web.xml files related to those web applications or what steps should I follow to achieve my task ??

              Please let me know if anyone has any suggestions or ideas or has gone through the process of doing this before !!

              Any help wiill behighly appreciated..

              Thanks:
              N.J