This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
We have a J2EE Application deployed on Weblogic 8.1 SP5 and we used the following option for
1. Created an XML File called weblogic-application.xml
2. The contents are as follows
<startup-class>NAME OF STARTUP CLASS</startup-class>
<shutdown-class>NAME OF SHUTDOWN CLASS</shutdown-class>
3. Now these classes were called when the application was deployed or undeployed.
However when migrated to Weblogic 10.3 Application server the same is not working.
Kindly suggest if this way is depricated in the new version of the Application server
and what is the way to implement this in the newer version.
The interface that is used for the startup / shutdown classes are deprecated. I cannot remember the new interface and configuration, but it is well documented.
This is a good chance to use a ServletContextListener instead of a weblogic startup class. That way your logic is less dependent on weblogic interfaces and is loosely coupled. It is highly unlikely the ServletContextListener will change. The same cannot be said for the weblogic startup class behaviour
Many thanks for the reply
I have incorporated the Application Life Cycle Events approach in which we have to write a listener which implements the ApplicationLifecycleListener and then write the startup and shutdown class and placed the STARTING Code inside the main method of the Startup class and the removal code in the shutdown class.
The result is as per expectation, but the issue is coming in clustered environment.
We have 2 servers and if we stop server one then the server 2 is not at all able to get the details, as I suppose as soon as server1 was stopped the resources were freed up. Kindly suggest