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?
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:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With