I'm trying to use a weblogic deployment plan to add init-param values to a vendor-provided .war file's web.xml.
While I realize that I can open the .war file and just edit the file inside, I'd prefer to use a deployment plan to accomplish this as I will need to deploy the .war file to multiple servers with different values for the init-param in question.
I have found many examples of how to do this on-line, but my efforts are hit and miss. I think that if I could see the impact of the deployment plan on my deployed war file, I would be able to quickly figure out what I am doing wrong.
Is there a way for me to view the runtime deployment descriptors of a weblogic (10.3.3) application after the deployment plan has been applied?
I spent some time investigating this a while back, and although WL10 unpacks the WAR in a temporary directory, it does not modify the files listed in the deployment plan in that location. I also tried using getResource/getResourceAsStream to read the whole web.xml, and found it to be the original, unmodified file as well.
I never did figure out how WL applies the changes so that they get picked up by the ServletContext without them being visible anywhere else. My guess is that it's using some trickery to override the loading of those files and applying the changes dynamically.
After fighting with it for a while, I eventually settled on something like the following to list out the values of the init parameters on startup:
if (log.isTraceEnabled()) {
final Enumeration<String> names = context.getInitParameterNames();
while (names.hasMoreElements()) {
final String key = names.nextElement();
final String value = context.getInitParameter(key);
log.trace("Init Parameter '{}' = '{}'", key, value);
}
}
(Using slf4j for the logging)
Of course it doesn't help a bit if there's something wrong with the deployment plan and the values aren't being set, but it's the best I could come up with.
In 12.2.1 there is a DebugDeploymentPlan Server debug setting, if on, the server logs something like
<After applying the overrides from the deployment plan, the descriptor "META-INF/ejb-jar.xml" is:
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