I have an application named HelloWorld installed, yet not deployed. Its state is Installed, like such:

When I’m trying to deploy it on target server, say AdminServer, it results in creating a new application named helloworld.war which is deployed on AdminServer whereas the original HelloWorld app remains in Installed state. App helloworld.war is the one that is in state Active… Snapshot:

Here’s the code I use to deploy the already installed app:
File warFilePath = new File("c:/helloworld.war"); // war file path on AdminServer machine
Target adminServerTarget = deployManager.getTarget("AdminServer");
WebLogicTargetModuleID targetModuleID = deployManager.createTargetModuleID(
"HelloWorld", ModuleType.WAR, adminServerTarget);
WebLogicTargetModuleID[] targetModuleIDs = new WebLogicTargetModuleID[1];
targetModuleIDs[0] = targetModuleID;
ProgressObject redeployProcessObject =
deployManager.redeploy(targetModuleIDs, warFilePath, null /*no deployment plan*/ );
There are two surprising facts, though.
First, when running this code on WebLogic versions 9.x to 10.3.3 it works great.
Second, when running this code from WLST prompt, with jython it also works great even on version 10.3.4 (I can attach the exact commands although they’re the same as java except for syntactic adoptions)…
My question is, how do I make it work also on 10.3.4?
I should have thought that no one would answer this question… 🙂
Anyway, I found a solution. I should have used
deployinstead ofredeploy, with aDeploymentOptionsof which name is the existing application name (HelloWorld):According to the docs,
redeployonly replaces the current application files and plan with an updated version. Whereasdeploydistributes the files (from the AdminServer) to the target(s) and starts the application.Also, after digging deep in WebLogic’s jython scripts and jars I found out that this is exactly what’s done when invoking
redeployin the WLST.