File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes how to check whether server is running or not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how to check whether server is running or not" Watch "how to check whether server is running or not" New topic
Author

how to check whether server is running or not

Sivakumar Nachimuthu
Ranch Hand

Joined: Aug 10, 2004
Posts: 52
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 ]
Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
You can do a ping on the server to see if it responds


SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
Sivakumar Nachimuthu
Ranch Hand

Joined: Aug 10, 2004
Posts: 52
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 ]
Anand Gondhiya
Ranch Hand

Joined: Feb 24, 2004
Posts: 155
telnet http://[machine-name]:[port]/

for ex: http://www.javaranch.com
Sivakumar Nachimuthu
Ranch Hand

Joined: Aug 10, 2004
Posts: 52
yaa u r right.but i want know thru my java code whether server running in the remote machine in th port 1099.
siva
Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
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.


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Siplin Ayishoto
Greenhorn

Joined: Nov 25, 2002
Posts: 9
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

Joined: Aug 10, 2004
Posts: 52
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to check whether server is running or not