How do I change the context-root of a web app with a deployment plan?

I've been trying to figure this out for several hours.
I'm deploying a .ear file which sets the context root for the single web application it deploys in its application.xml deployment descriptor:
<application>
<display-name>MyApp</display-name>
<module>
<web>
<web-uri>MyAppViewControler.war</web-uri>
<context-root>MyApp</context-root>
</web>
</module>
</application>
I want to change the context-root from /MyApp to something else when deploying the ear file. It seemed to me that using a deployment plan was the way to do this. But when I use this plan:
<deployment-plan>
<application-name>MyApp<application-name>
<variable-definition>
<variable>
<name>NEWCONTEXTROOT</name>
<value>foobar</value>
</variable>
</variable-definition>
<module-override>
<module-name>MyApp</module-name>
<module-type>ear</module-type>
<module-descriptor external="false">
<root-element>application</root-element>
<uri>META-INF/application.xml</uri>
<variable-assignment>
<name>NEWCONTEXTROOT</name>
<xpath>/application/module/web/context-root</xpath>
</variable-assignment>
</module-descriptor>
</module-override>
</deployment-plan>
I get an error:
weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
/bea/user_projects/domains/devod1/nullplan.xml:0: problem: cvc-complex-type.2.4a: Expected element 'web-uri@http://java.sun.com/xml/ns/javaee' instead of 'context-root@http://java.sun.com/xml/ns/javaee' here in element web@http://java.sun.com/xml/ns/javaee:<nullplan.xml>
I looked at http://e-docs.bea.com/wls/docs103/pdf/deployment.pdf which says:
"You cannot use a deployment plan to change the context-root in an application.xml
file. However, if an application is deployed as a library, you can either change the
context-root through an weblogic-application.xml file or use the deployment plan
to change the context-root in an weblogic-application.xml file."
I don't understand what this means. I'm not deploying my application as a library.
Does anyone know how to change the context-root for an application?
Any help would be greatly appreciated!

Hi James,
I am quite new to Welogic if i am wrong please correct me.I have re-deployed my application (.war) with this Plan.xml
&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;deployment-plan xmlns="http://www.bea.com/ns/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/deployment-plan http://www.bea.com/ns/weblogic/deployment-plan/1.0/deployment-plan.xsd" global-variables="false"&gt;
&lt;application-name&gt;BrowserR08.003&lt;/application-name&gt;
*&lt;variable-definition&gt;*
* &lt;variable&gt;*
* &lt;name&gt;CONTEXTROOT&lt;/name&gt;*
* &lt;value&gt;BrowserWeb/servlet/BrowserServlet&lt;/value&gt;*
* &lt;/variable&gt;*
* &lt;/variable-definition&gt;*
&lt;module-override&gt;
&lt;module-name&gt;BrowserWeb.war&lt;/module-name&gt;
&lt;module-type&gt;war&lt;/module-type&gt;
&lt;module-descriptor external="true"&gt;
&lt;root-element&gt;weblogic-web-app&lt;/root-element&gt;
&lt;uri&gt;WEB-INF/weblogic.xml&lt;/uri&gt;
&lt;hash-code&gt;1231953167814&lt;/hash-code&gt;
*&lt;variable-assignment&gt;*
* &lt;name&gt;CONTEXTROOT&lt;/name&gt;*
* &lt;xpath&gt;/weblogic-web-app/context-root&lt;/xpath&gt;*
* &lt;operation&gt;add&lt;/operation&gt;*
* &lt;/variable-assignment&gt;*
&lt;/module-descriptor&gt;
&lt;module-descriptor external="false"&gt;
&lt;root-element&gt;web-app&lt;/root-element&gt;
&lt;uri&gt;WEB-INF/web.xml&lt;/uri&gt;
&lt;/module-descriptor&gt;
&lt;module-descriptor external="true"&gt;
&lt;root-element&gt;wldf-resource&lt;/root-element&gt;
&lt;uri&gt;META-INF/weblogic-diagnostics.xml&lt;/uri&gt;
&lt;/module-descriptor&gt;
&lt;/module-override&gt;
&lt;config-root&gt;/export/home1/tecapp/BrowserR08.003/plan&lt;/config-root&gt;
&lt;/deployment-plan&gt;
I do not know wether i will require the other module descriptor definition in this Plzn.xml. Now when I go to following link.
Deployments --&gt; MyApp --&gt; Testing
It gives me following url as a test page:
http://localhost:7001/BrowserWeb/servlet/BrowserServlet
as soon as i click on to the above link it redirects me to following.
http://localhost:7001/BrowserWeb/servlet/BrowserServlet/servlet/BrowserServlet
Same if i remove these context-root part my normal Testing menu shows me following link as my webapp access path
http://localhost:7001/BrowserWeb &lt;-- My war file name is BrowserWeb.war so it is default name of my deployed application if i am not wrong
and as soon as i click on above link it redirects me to the following one.
http://localhost:7001/BrowserWeb/servlet/BrowserServlet
It means application server know that my full web access page is with '*servlet/BrowserServlet*' because its adding it in both the cases.
What I want is a constant URL whcih does not change?
Hope this helps :)

Similar Messages

  • How can I change the install location when installing an App (i.e. Lightroom) from Creative Cloud?

    How can I change the install location when installing an App (i.e. Lightroom) from Creative Cloud?

    Rolfjuelg I am sorry but Lightroom does not support custom installation locations through the Creative Cloud.  You can find more details at Lightroom and Creative Cloud FAQ.

  • TS1702 How do I change the Apple ID in an installed APP?  I have changed the apple ID in all the other apps due to security reasons. All changes were effective except the APPS ID.Where do I go to change the Apple ID?

    How do I change the Apple ID in an installed APP?  I have changed the apple ID in all the other apps due to security reasons. All changes were effective except the APPS ID.Where do I go to change the Apple ID for the APPS store?  Thanks in advance.

    You do not.  Apps and any content purchased from the iTunes store are eternally tied to the Apple ID they were purchased with.

  • How can u change the email address on ur iTunes app?

    How can u change the email address on ur iTunes app?

    Settings>iTunes and App Store. Tap the ID and sign out. Then sign in with the new one.

  • HT4972 How do you change the computer that you sync apple devices with

    How do you change the computer that you sync apple devices with?

    Sync with new computer
    https://discussions.apple.com/docs/DOC-3141

  • How do I change the apple ID my iPad is associated with

    I'm trying to figure out how to change the Apple ID our iPad is associated with. My husband bought the iPad and set up a new Apple ID instead of using mine. Now we cannot use iCloud to sync all of our devices. Any help out there?

    Hi there
    Try this...
    1. Settings
    2. Store
    3. Click on 'Apple ID'
    4. Click on 'Sign Out
    5. Click on 'Sign In'
    6. Click on 'Use Existing Apple ID'
    7. Type in your Apple ID
    Hope that helps.
    Cheers

  • I use the company's iPad at work that has a different apple id for iCloud than my own personal iPad  at home. How can I change the company's iCloud id to synchronize with my own one?

    I use an iPad 2 at work that has a different apple id for iCloud than my own personal new iPad. How can I change the company's id for iCloud to synchronize with my own personal iPad?

    Go to Settings>iTunes and App Stores and tap the Apple ID listed and sign out and sign in with other ID
    You also may want to go to other places like:
    - Settings>iCloud
    - Settinge>FaceTime
    - Settings>Messages>Send and Receive and change the ID
    It may be best to go to Settings>General>Reset>Erase all Content and Settings and start over again and set up the iPod again with his account/ID

  • How do I change the document root and servlets root in WL 6.0

    Please reply fast.
    Suresh Wilson

    In 5.1, you specify the "name" via the property:
    weblogic.httpd.webApp.NAME=<path_to_war>
    ... where NAME is the path in the URL where you want your webapp to be
    access from
    Say:
    weblogic.httpd.webApp.sampleapp=/home/weblogic/product/wls/5.1/sample.war
    ... the application's root is http://hostname/sampleapp
    In 6.0, it seems to be the name of the war file itself. I deployed the
    war twice, one using sampleapp.war and the other using sampleapp2.war,
    and the webapps' root are http://hostname/sampleapp and
    http://hostname/sampleapp2, respectively.
    Is this rigth? Well, that is at least what I observed. The admin docs
    regarding deploying was not clear on what is defined as "name" or where
    it gets it from ... until I tried the above.
    For a while, I thought that the application's root are defined by the
    servlet spec.
    John
    Gene Chuang wrote:
    >
    Servlets in 6.0 must be deployed in .war; "document root" setting is irrelevant in 6.0.
    Gene
    "suresh wilson" <[email protected]> wrote in message news:[email protected]..
    Please reply fast.
    Suresh Wilson
    Homepage: http://homepages.tig.com.au/~jmsalvo/

  • How can I change the color of chart in webi report

    Hi :
      I create one Webi report including one table and chart  In BO 4.0.
    The chart  display  the relationship between sales-amount and profit amount . I do not want to use the default color but want to specify the red color for sales-amount and yellow color for profit amount . How can I do it ??
    Thanks Very Much
    Emily MA

    Hi,
    You can change the color very easily. It's simple & straight forward which I found it couple of days back. (Sometimes simple things are hard to find :-p )
    Select the area in the Chart that you want to change color, then go to Format > Style > Background color. Now select the color that you want. In the attached picture, I have selected Yellow color for a piece of pie chart.

  • How do I change the apple Id used for updating apps and downloading them

    I bought an iPad from someone and I changed the apple ID but for some reason when I try to update the apps the old apple ID comes up from the previous owner ...........I just need to know how I possibly can change it

    You cannot.  Purchases are permanently tied to the AppleID and its account used when making the purchase.  You cannot transfer purchases.
    The reality is you do not own the apps on that iPad - the previous owner does.  If you want them for yourself and want to be able to update them as needed, or re-download them as needed, you will have to delete the copies on the iPad, then purchase them with your own AppleID.

  • How do I change the Apple Id on my iPad app updates?

    When updating apps on my ipad2, the wrong Apple Id shows up (an id from another family member's iPhone).  We use the same pc with itunes.  How can I change this so only my app updates are shown?  This is the only place that this Id shows up incorrectly.  My correct id shows up in Settings.

    Apps are always associated with the Apple ID that was used to purchase them. AFAIK - as long as you are using apps on your iPad that were purchased with another Apple ID - those app updates will always popup when they are available. The only way to remove the updates is to delete the apps.

  • How do I change the default certificate in Java Web Console?

    I have a 3rd party issued server keystore & truststore ready to go in both jks and p12 file formats. I wish to use this in the Sun Java Web Console instead of the self signed certificate. I cannot find any documentation as to changing the certificate. I did find commands to change the keystore and truststore passwords, but I want to change the entire certificate.
    I tried manually messing with the /var/webconsole/domains/console/conf/server.xml configuration file but realized it was more complex than that. Is there a documented procedure for changing the default certifcate?
    Thanks

    Siri will use the default calendar specified in the Mail, Contacts, Calendars setting.
    Go to Settings/Mail,Contacts,Calendars, then scroll down, and change the default in the Calendars section to your the one you prefer.
    hope this helps.

  • How can I get the context-parm from a web.xml file using struts?

    Hello:
    I need get the context-param from the web.xml file of my web project using struts. I want configurate the jdbc datasource connection pooling here. For example:
    <context-param>
    <param-name>datasource</param-name>
    <param-value>jdbc/formacion</param-value>
    <description>Jdbc datasource</description>
    </context-param>
    and then from any Action class get this parameter.
    Similar using a simple server can be:
    /** Initiates new XServlet */
    public void init(ServletConfig config) throws ServletException {
              for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();) {
                   System.out.println(e.nextElement());
              super.init(config);
              String str = config.getInitParameter("datasource");
              System.out.println(str);
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException {
              // res.setContentType( );
              System.out.println("Got post request in XServlet");
              PrintWriter out = res.getWriter();
              out.println("nada");
              out.flush();
              out.close();
    but only this works for init-params, if I use
    <servlet>
         <servlet-name>MyServlet</servlet-name>
         <display-name>MyServlet</display-name>
         <servlet-class>myExamples.servlet.MyServlet</servlet-class>
         <init-param>
         <param-name>datasource</param-name>
         <param-value>jdbc/formacion</param-value>
    </init-param>
    </servlet>
    inside my web.xml. I need something similar, but using struts inside the action class for that I can get the context-params and call my database.
    Thank you

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • I am a PC user now adjusting to the iMac. How can I change the font setting so that every app is the same font...larger than what is currently showing?

    I am new to th imac, having used a PC all of my life. I would like to set the text size for all applications, is this possible?

    You can only do that globally by changing the screen resolution. In OS X it is on an application by application basis, if you can change it at all. For instance, for finder windows choose  View menu > Show view options. In Text Edit in Preferences > New Document. Mail > Format > Show Fonts but this is only for messages text.
    In short, Apple wants you to live with what you've got and dosen't make it easy to change any fonts except the ones you use to compose.

  • How can I change the time zone for a calendar entry with iOS 7?

    I want to make a new entry in my calendar (iOS 7) using a different time zone as the one I'm located in. There isn't any option to choose the time zone like there is in OS X.
    I know I can switch off the option to automatically change the time zone in the preference pane of Mail, Contacts and Calendar to get the option in calendar but I want to use this automatic switch.
    Is there any option to change the time zone of a calendar entry without loosing this automatic switch?

    Got it!
    In your backing file you'll need the following in your handlePostbackData method:
    BookBackingContext bookCtx = BookBackingContext.getBookBackingContext(arg0);
    bookCtx.setupPageChangeEvent("PageLabel");

Maybe you are looking for