cancel
Showing results for 
Search instead for 
Did you mean: 

destroy method of servlet not called when J2EE engine is shutdown...

Former Member
0 Kudos

Hi,

Wrote a servlet implementing destory() method. Whenever the webcontainer service is shutdown(from J2EE visual admin) I see that the destroy method is called.

However when the server (WAS 7.0 SP9) itself is shutdown, the destroy method is not getting called.

Is there anything that I am missing? Will appreciate any help on this.

Thanks,

Shaji

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

Hello ,

Try this code ,

Class classObject = Class.forName("SecondServlet");

SecondServlet servlet = (SecondServlet)classObject.newInstance();

servlet.init(getServletConfig());

System.out.println("Before calling the service() from TestServlet");

servlet.service(req,res);

servlet.destroy();

Regards ,

Venkat