• 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
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

how to know whether server instance is running or not?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
how do i know from the normal java class whether server instance in cluster(say weblogic cluster) is running if the server name and port are given?i can able to do that by using the URL to a resource but it is taking time.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Setting up a HttpURLConnection and trying to retrieve a page is about the only thing I have done. I wonder why that's taking too much time for you. If the server is up it should respond pretty quickly, and if it's down you should get the error even more quickly.

I have done this on web services and found a system where the HTTP server was up so I got no HTTP error, but the business service was "stopped" somehow. By some quirk in their code it just never returned anything.

You might find some administrative interface to query. In Java 5 and later, see how JConsole connects to a JVM and queries it. Can't imagine the connect would be much faster than an HttpURLConnection.
 
Sheriff
Posts: 28409
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i can able to do that by using the URL to a resource but it is taking time.

You should expect it to take some time. I assume you aren't only interested in whether it is running, you are really interested in whether it is capable of responding to requests? Then the time to find that out would be comparable to the time to send a request and receive the response.
reply
    Bookmark Topic Watch Topic
  • New Topic