2 Replies Latest reply on Jun 2, 2006 7:06 AM by apill

    Can you change the context root of a deployed ear?

    apill

      Can you change the context root of a deployed ear? I don't mean the context root of a web app, but the actual ear.

      i.e. If I deploy my-application-1.1.ear to jboss it deploys with a context root of my-application-1.1.

      Is it possible to deploy my-application-1.1.ear to jboss with the context root of my-application?

      A quick response would be greatly appreciated.
      Thanks.

      Adrian

        • 1. Re: Can you change the context root of a deployed ear?
          visolvejboss

          Hello,

          The context-root of an EAR file is taken from the application.xml incase if you have specified the context-root, otherwise take it from the warfile name.

          In your case, you have to configure the context path in application.xml file as shown below.

          <module>
           <web>
           <web-uri>my-application-1.1.war</web-uri>
           <context-root>my-application</context-root>
           </web>
           </module>


          Regards,
          ViSolve JBoss Team

          • 2. Re: Can you change the context root of a deployed ear?
            apill

            Thanks for the reply, but your example changes the war context root, not the ear context root.

            I am trying to change the context root of the ear being deployed, not the war.

            i.e. if i deploy an ear named my-ear-1.2.ear containing a war my-war-1.2.war it will deploy with the JNDI context

            my-ear-1.2/my-war-1.2
            .

            If i do what you say and add the following application.xml

            <module>
             <web>
             <web-uri>my-war-1.2.war</web-uri>
             <context-root>my-war</context-root>
             </web>
             </module>


            it will deploy with JNDI context of
            my-ear-1.2/my-war
            .

            What I want to be able to do is deploy my ear to the following JNDI context, for example.
            my-ear/my-war
            .