• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Startup class in WAS

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I would like to have some sort startup class which would be executed when the server starts up. How can this be achieved? How can I specify the startup class in the administrative console
Any help will be appreciated.
Abhi
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What version of WebSphere are you using? The answer depends on that...
Kyle
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To some extent, IBM makes WAS 4.0 startup class useless. Say, the new custom service doesn't support JNDI service. In the bank, I am working for, some people developed a ejb framework for WAS 3.5. This framework works as part of container, because it is started by start up class. However, the current startup class doesn't work with this framework which uses JNDI service. Also, there is some classpath problem. If this framework load some classes, my ejb cannot see them. Weird. So be careful with startup class.
Go to info center and there is a chapter for Custom Service. That is about the startup class, if you are using 4.0. I cannot rember the name of the interface. I think there is a method defined in the interface called initilize. Also, another method is called terminate or something.
[ January 31, 2002: Message edited by: Jun Hong ]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can specify the tag in the Web.xml for the corresponding class to start when the server starts.
<load-on-startup> 1 <load-on-startup>
 
j krishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can specify the tag in the Web.xml for the corresponding class to start when the server starts.
load-on-startup 1 load-on-startup
 
AbhiRaj
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kyle,
I am working on IBM Websphere Enterprise edition 4.0. I need to load quite a lot of data during the start up.
Abhi
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, now what do you mean by "load a lot of data". Are you talking about Singletons? Are you writing a Servlet/JSP application or an EJB application?
Kyle
 
AbhiRaj
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kyle,
 
AbhiRaj
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kyle,
I wanted to load a quite a lot of master data from the database, when the server starts. We are following a typical MVC architechure. I need to write a startup class which will load this master data which would be available for populating the master data as required on the screen.
I hope things are clear..
Abhi
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I understand now. Well, since you will probably want to use Connection poools, and maybe even EJB's to do this, I would suggest that you handle this kind of thing in the init() method of your front controller servlet. Just make sure that your web.xml file has that servlet marked as "load on startup", as noted above. That is probably the best way to handle it.
Also as noted above the other method of startup execution available in WebSphere has problems in that it runs BEFORE the EJB container and other things are initialized.
Kyle
[ February 02, 2002: Message edited by: Kyle Brown ]
 
You've gotta fight it! Don't give in! Read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic