File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

StartUp class in Weblogic 10.3 Application Server

 
Gagan Tiwari
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
We have a J2EE Application deployed on Weblogic 8.1 SP5 and we used the following option for
startup class.

1. Created an XML File called weblogic-application.xml
2. The contents are as follows

<weblogic-application>
<startup>
<startup-class>NAME OF STARTUP CLASS</startup-class>
<startup-uri>startup.jar</startup-uri>
</startup>
<shutdown>
<shutdown-class>NAME OF SHUTDOWN CLASS</shutdown-class>
<shutdown-uri>startup.jar</shutdown-uri>
</shutdown>
</weblogic-application>
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.

 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gagan Tiwari
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


I am not sure what you mean by this. When you stop server one, it frees up some resources and when you stop server 2 it tries to free the same resources ?

ApplicationLifecycleListener


Ah yes that rings a bell
 
Gagan Tiwari
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me just elaborate a bit more on this.

I am starting a Thread which is listening to the Queue (MQ) for getting the messages and processing the same.

so we start the thread in startup and stop the same in shutdown class.

Now in clustered environment we have two servers running and say when ONE goes down, its triggers the stopping of thread and hence even though server 2 is running the messages are not being processed.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the JMS queue also clustered or does it run in server one alone ?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic