How to remove out-of-sync, deleted autodeployed apps from Weblogic
Asked Answered
V

1

15

being new to Weblogic, I followed some readme files to deploy apps to Weblogic, by copying the war files to the autodeploy folder. They automatically showed in the Weblogic console, so far so good.

Later, I deleted some of these apps from the autodeploy folder, expecting them to also disappear from the Deployments page. To my surprise, once I started the server, they were still there, and I couldn't remove them either: Weblogic was saying that I needed to delete the wars from the autodeploy folder (!).

Of course, I should have read the documentation first, that states the following:

Auto-Deploying, Redeploying, and Undeploying Archived Applications

To auto-deploy an archived application, copy its archive file to the /autodeploy directory. WebLogic Server automatically sets the application’s deployment mode to stage mode.

A deployment unit that was auto-deployed can be dynamically redeployed while the server is running. To dynamically redeploy, copy the new version of the archive file over the existing file in the /autodeploy directory.

To undeploy an archived deployment unit that was auto-deployed, delete the application from the /autodeploy directory. WebLogic Server stops the application and removes it from the configuration. Note: If you delete an application from the /autodeploy directory when the server is not active, WebLogic Server will not detect that the application was deleted even when the server is again in an active state. In order to prevent an out-of-sync domain tree, BEA recommends that you only remove applications from the /autodeploy directory when the server is in an active state.

Since I've deleted the files while the server was down, they still show up there. What is not in this particular documentation is how to fix it once it's out-of-sync.

Valenzuela answered 13/1, 2015 at 15:51 Comment(0)
V
34

The answer is quite simple.

  1. Navigate to your Weblogic's domain folder using a File Manager (Windows Explorer or Nautilus, for instance).

  2. Open the config.xml file in the config folder;

  3. Find the apps you've deleted between the <app-deployment> tags.

  4. Remove them from the xml file;

  5. Restart your server.

Valenzuela answered 13/1, 2015 at 15:51 Comment(4)
This works but you should simply be able to open the admin console, click the deployments link, and delete the application there without having to edit the config.xml directlyCephalopod
Indeed. Even better, it should detect that the folder has changed while it was down and update automatically...Valenzuela
@DisplayNameismissing This doesn't work as WL only lets you delete web apps that were deployed manually. If you deploy via autodeploy, WL won't let you do this.Baku
@Baku - the joys of weblogic!Cephalopod

© 2022 - 2024 — McMap. All rights reserved.