Search code examples
javaejbweblogicjndi

Weblogic : Is there a way to run a Java method while undeploying ear file?


I have deployed an ear file named abc.ear to weblogic 10.3.6.

Inside the ear file, there are several class files. The main Java class file is abc.class

Here I would like to ask if there is a way to tell the JVM to run a java method if I am undeploying / delete the abc.ear file from weblogic?

I want to unbind some JNDI in that Java method.

Thanks


Solution

  • You can attach an ApplicationLifeCycleListener . See link: http://docs.oracle.com/cd/E13222_01/wls/docs92/programming/lifecycle.html#wp1049765