Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weblogic 12C - Is there a way to edit the variables of a deployment plan from the console?

We are new to Weblogic (12c). We try to choose how we're going to pass some configurations to the application depending on the environment it is running on (dev / staging /prod).

I'm currently trying to use a deployment plan. In WEB-INF/web.xml, I have :

<context-param>
    <param-name>test</param-name>
    <param-value>11111</param-value>
</context-param>

And I use a plan.xml for my application in Weblogic. Some parts :

<variable-definition>
    <variable>
        <name>test</name>
        <value xsi:nil="false">22222</value>
        <description>some description</description>
    </variable>
</variable-definition>

and

<module-descriptor external="false">
    <root-element>web-app</root-element>
    <uri>WEB-INF/web.xml</uri>
    <variable-assignment>
        <name>test</name>
        <xpath>/web-app/context-param/[param-name="test"]/param-value</xpath>
        <origin>planbased</origin>
        <operation>replace</operation>
    </variable-assignment>
</module-descriptor>

This works!

But I heard it could be possible to change the value of the variable from the administration console, is that true?

When I browse my application in the console (in the Deployment Plan tab or in the Configuration tab), I do not see any field which I could use to change the test variable... Am I missing something or must the values of overriding variables be set in the plan.xml file itself?

like image 508
electrotype Avatar asked Sep 29 '22 11:09

electrotype


1 Answers

I do not think you can change the variable directly, I believe this is because it's a fundamental change to the deploy that requires a "hot update" BUT you can easily "redeploy/update" with a new plan. This is how you would do it in a production environment:

  • From the Weblogic admin console, click Deployments, click the checkbox next to your ear/war
  • Click Update
  • The next screen will ask you for the source path and the deployment plan path, you can change just the deployment plan path to set your new value(s)

You can also call java weblogic.Deployer with the update option if you want to do it from the command line.

It is also possible to do the same via WLST scripting - see these Oracle Docs

like image 111
Display Name is missing Avatar answered Oct 04 '22 02:10

Display Name is missing