Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Wait for the server to start

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Apache Axis in weblogic 8.1. Now the problem with webservices is that we need to "register" the webservice by running "AdminClient". Normally this is done via Command prompt AFTER the server has started up. But now I am looking to automate this..what I did was put this "AdminClient" thing in a servlet and in the init method...but obviously it got executed before the server could start up and I get a "Connection refused" error.

I was wondering if there is a way for my servlet to wait until the server has started and then execute.

something like...

while(server_has_not_started){
--dont do anything
}
if(server_has_started){
--execute
}
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A servlet will not "start" until the server is up. But, a better way to do this is with a context listener.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can the following be possible.

what I did was put this "AdminClient" thing in a servlet and in the init method...but obviously it got executed before the server could start up and I get a "Connection refused" error.



After the server starts up, then it initializes the various application contexts one by one and when you applications turn comes , it loads all the servlets with load on startup tag.So your servlet is getting executed after the servers starts.

One more thing related to this.Your servlet that had the code for adminclient of axis might be getting executed before the axis servlet is getting initialized.You can load the axis servlets using load on startup like your initializing servlet but with less numeric value than what you set for your servlet.

But for such purposes context listners are more prefered.
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And while we're at it...

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Arthur Ford
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks, Thanks for the replies...I did try and arrange the "load-on-startup" for the servlets...but I am still stuck with the same problem

This is how my web.xml looks


And this is what I get...

 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Arthur Darklord", My request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.

Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic