tag:blogger.com,1999:blog-3237724005744642470.post6861512543716441582..comments2019-07-03T10:00:00.514+01:00Comments on Captain Debug's Blog: Three Spring Bean Lifecycle TechniquesRoger Hugheshttp://www.blogger.com/profile/07042290171112551665[email protected]Blogger4125tag:blogger.com,1999:blog-3237724005744642470.post-81731933728995662932013-10-29T05:12:25.678+00:002013-10-29T05:12:25.678+00:00Hey Roger, Thanks for given a hint :) @PreDestroy...Hey Roger,<br /><br />Thanks for given a hint :) @PreDestroy in EJB solve my issue. I already using EJB+Spring but forgot to try with this.<br /><br />It is really frustrated that weblogic10.3.5 not supported servlet3.0 and spring3.0. Otherwise i was trying to dynamic initialization servlet and use its destroy method. Thanks again :)<br /><br /> Noman Sadiqhttps://www.blogger.com/profile/18210042419201464901[email protected]tag:blogger.com,1999:blog-3237724005744642470.post-58967396575159790852013-10-26T08:51:06.747+01:002013-10-26T08:51:06.747+01:00Noman A really good question. I can&#39;t think of...Noman<br />A really good question. I can&#39;t think of any &#39;official&#39; way of doing this, but have a couple of ideas. Firstly, and I&#39;ve not tried this, as this is Weblogic you can deploy your application as an EAR file rather than a WAR file. This means that you could include an EJB in your application. You can then annotate a method in your EJB with @PreDestroy. In this method you could get hold of the application context using <a href="/2011/04/using-spring-contextsingletonbeanfactor.html#.Umtzq2Tk8jc" rel="nofollow">ContextSingletonBeanFactoryLocator</a>. With the ApplicationContext you can enumerate through the beans it contains calling their destroy() methods.<br /><br />To make this work, You may have to ensure that the application context is loaded by annotating anther method with @PostConstruct.<br /><br />There is a really good book on Weblogic Server available on <a href="http://www.amazon.co.uk/Professional-Oracle-WebLogic-Server-ebook/dp/B004HD69J2/ref=sr_1_6?s=books&amp;ie=UTF8&amp;qid=1382773652&amp;sr=1-6&amp;keywords=oracle+weblogic+server" rel="nofollow">Amazon</a>, which might contain a better answer.Roger Hugheshttps://www.blogger.com/profile/07042290171112551665[email protected]tag:blogger.com,1999:blog-3237724005744642470.post-25501906093621956882013-10-24T12:29:46.593+01:002013-10-24T12:29:46.593+01:00Hi, Can you please tell me how can i call the des...Hi,<br /><br />Can you please tell me how can i call the destroy-method when application is stop from weblogic server rather than jvm down. I deploy my application on weblogicc server and registerShutdownHook with context but my destry-method is not calling when i stop the application by myself on weblogic. <br />Please tell me a way for thatNoman Sadiqhttps://www.blogger.com/profile/18210042419201464901[email protected]tag:blogger.com,1999:blog-3237724005744642470.post-60366949737499758962013-10-24T12:29:17.831+01:002013-10-24T12:29:17.831+01:00Hi, Can you please tell me how can i call the des...Hi,<br /><br />Can you please tell me how can i call the destroy-method when application is stop from weblogic server rather than jvm down. I deploy my application on weblogicc server and registerShutdownHook with context but my destry-method is not calling when i stop the application by myself on weblogic. <br />Please tell me a way for thatNoman Sadiqhttps://www.blogger.com/profile/18210042419201464901[email protected]