title: Why does weblogic not use my deployment plan?
body: <p>I am having some trouble trying to adjust the deployment settings of our application in weblogic.  I feel what I'm trying to do ought to be quite simple, but it's not working as expected.</p>
  
  <p>I am just trying to override the context-root in weblogic.xml and the JNDI name for the data source, so these can both be configured at deployment time.</p>
  
  <p>I have removed the application.xml from the ear file, so that shouldn't be affecting the overrides.</p>
  
  <p>What I have so far:</p>
  
  <p>weblogic.xml:</p>
  
  <pre><code>&lt;context-root&gt;mosaic&lt;/context-root&gt;
  
  &lt;resource-description&gt;
    &lt;res-ref-name&gt;jdbc/LogicalDS&lt;/res-ref-name&gt;
    &lt;jndi-name&gt;LogicalDS&lt;/jndi-name&gt;
  &lt;/resource-description&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;resource-ref&gt;
    &lt;description&gt;A logical reference to the datasource - mapped in deployment plan&lt;/description&gt;
    &lt;res-ref-name&gt;jdbc/LogicalDS&lt;/res-ref-name&gt;
    &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
    &lt;res-auth&gt;Container&lt;/res-auth&gt;
  &lt;/resource-ref&gt;
  </code></pre>
  
  <p>plan.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;wls:deployment-plan xmlns:wls="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd" global-variables="true"&gt;
   &lt;!--weblogic-version:10.3.5--&gt;
   &lt;wls:application-name&gt;mosaic.ear&lt;/wls:application-name&gt;
   &lt;wls:variable-definition&gt;
      &lt;wls:variable&gt;
          &lt;wls:name&gt;datasource_name&lt;/wls:name&gt;
          &lt;wls:value xsi:nil="true"&gt;&lt;/wls:value&gt;
          &lt;wls:description&gt;The name of the datasource to map to the mosaic application&lt;/wls:description&gt;
      &lt;/wls:variable&gt;
      &lt;wls:variable&gt;
          &lt;wls:name&gt;new_context_root&lt;/wls:name&gt;
          &lt;wls:value xsi:nil="true"&gt;&lt;/wls:value&gt;
          &lt;wls:description&gt;URL to deploy Mosaic at&lt;/wls:description&gt;
      &lt;/wls:variable&gt;
   &lt;/wls:variable-definition&gt;
  &lt;wls:module-override&gt;
      &lt;wls:module-name&gt;mosaic.war&lt;/wls:module-name&gt;
      &lt;wls:module-type&gt;war&lt;/wls:module-type&gt;
      &lt;wls:module-descriptor&gt;
          &lt;wls:root-element&gt;weblogic-web-app&lt;/wls:root-element&gt;
          &lt;wls:uri&gt;WEB-INF/weblogic.xml&lt;/wls:uri&gt;
          &lt;wls:variable-assignment&gt;
              &lt;wls:name&gt;new_context_root&lt;/wls:name&gt;
              &lt;wls:xpath&gt;/weblogic-web-app/context-root&lt;/wls:xpath&gt;
              &lt;wls:operation&gt;replace&lt;/wls:operation&gt;
          &lt;/wls:variable-assignment&gt;
          &lt;wls:variable-assignment&gt;
              &lt;wls:description&gt;Data source for mosaic application&lt;/wls:description&gt;
              &lt;wls:name&gt;datasource_name&lt;/wls:name&gt;
              &lt;wls:xpath&gt;/weblogic-web-app/resource-env-description/resource-env-ref-name&lt;/wls:xpath&gt;
              &lt;wls:operation&gt;replace&lt;/wls:operation&gt;
          &lt;/wls:variable-assignment&gt;
          &lt;wls:variable-assignment&gt;
              &lt;wls:name&gt;datasource_name&lt;/wls:name&gt;
              &lt;wls:xpath&gt;/weblogic-web-app/resource-description/[res-ref-name="jdbc/LogicalDS"]/jndi-name&lt;/wls:xpath&gt;
              &lt;wls:operation&gt;replace&lt;/wls:operation&gt;
          &lt;/wls:variable-assignment&gt;
      &lt;/wls:module-descriptor&gt;
    &lt;/wls:module-override&gt;
  &lt;/wls:deployment-plan&gt;
  </code></pre>
  
  <p>Nothing happens when I use the deployment plan, and none of the variables appear under the Deployment Plan configuration screens in the admin console.  From what I understand, I should at least be asked for these variables, since I have specified that they are null in the deployment plan.</p>
  
  <p>When I use WLST to browse the tree, I find that the runtime configuration just stays as the values in the deployment descriptors.</p>
  
  <p>I have verified the deployment plan is being used in the general tab of the admin console.</p>
  
  <p>Can anyone help me find out what I am doing wrong here ?</p>