fredag 4. november 2011

Weblogic: Cannot undeploy autodeployed application - solved...

If you're using autodeploy on the Weblogic 10.3 server there is an issue regarding undeployment you should be aware of. (Solution at the very end...)
When autodeploying an application you simply add the application (or files) to the autodeploy folder of your server. The appserver notices the change, and tries to deploy the application. Regarding to the manual, if you want to undeploy the application simply delete the files from the autodeploy folder.

HOWever, what is mentioned in passing is that "undeploying" aka deleting an application that is not in active mode on the appserver will in many cases do nothing. According to the manual, this is because the appserver will not notice the change when the application is in another state, eg. "Installed", "Prepared" etc. This may not be much of an issue until you've deployed an application containing errors that prohibits it from starting.

I named it Weblogic §22, in honor of Catch 22; You cannot undeploy an autodeployed application that is not started, but you want to undeploy the application because it won't start. In my case, I wanted to perform a regular deployment, but then I couldn't start due to conflicts with the autodeployed application.

Trying to delete (aka undeploy) the application using the console yielded "To undeploy an archived deployment unit that was auto-deployed, delete the application from the /autodeploy directory." Deleting the application from /autodeploy yielded nothing, as the application was in "Prepared" state, but then trying to undeploy gave an error that the files could not be found. I also tried restarting, deleting and restarting, adding an empty file and so on and so forth.
The solution turned out to be brutal, but simple:

  1. Delete contents of all cache and temp folders on the server.
  2. Search for the applications name in all files in your Weblogic folders.
  3. Remove everything regarding the application. In my case that was in config.xml and ConsolePreferences.xml
  4. Restart server

Ingen kommentarer:

Legg inn en kommentar