• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to check whether server is running or not

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My EJBs are deployed in server.
In case server is not running and i lookup the bean in client using context.lookup() ..
Exception is shown that connection refused like this




So i want to check whether server is running before i lookup.How can i do that?
Thanks in advance
Siva

[ October 27, 2004: Message edited by: Sivakumar Nachimuthu ]
[ October 27, 2004: Message edited by: Sivakumar Nachimuthu ]
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can do a ping on the server to see if it responds
 
Sivakumar Nachimuthu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Server machine may be running.
But i want to know whether Jboss server running
in the remote server machine in the port 1099.

Thanks
Siva
[ October 27, 2004: Message edited by: Sivakumar Nachimuthu ]
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
telnet http://[machine-name]:[port]/

for ex: http://www.javaranch.com
 
Sivakumar Nachimuthu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yaa u r right.but i want know thru my java code whether server running in the remote machine in th port 1099.
siva
 
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sivakumar Nachimuthu:
yaa u r right.but i want know thru my java code whether server running in the remote machine in th port 1099.
siva




Hello Siva,
I think you should try using java.net package for this purpose.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why dont you catch that exception? (it is not a runtime exception...)
Also, I dont see what you can achieve by knowing it 'beforehand'.
-Siplin
[ November 10, 2004: Message edited by: Siplin Ayishoto ]
 
Sivakumar Nachimuthu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
we cant catch these exception.The Above exception was caught inside jboss naming server and printStackRace of exception is printed by jboss naming service.

Siva
 
reply
    Bookmark Topic Watch Topic
  • New Topic