This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 26966
84
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