File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes Getting Was node's name? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Getting Was node Watch "Getting Was node New topic

Getting Was node's name?

mik laan

Joined: Sep 04, 2002
Posts: 29
I have a clustered environment with multiple Was instances and clones.
Are there any Was related java class, JNDI entry or system property
(System.getProperty()) that could be used in my java applicalition to tell in which node my application is running?
Raj Varanasi

Joined: Nov 20, 2001
Posts: 11
Usually hostname will be node name for websphere in a clustered environment.You can use the following code(jsp code) to get the hostname in ur java application.This is for solaris environment.

<%@ page import="*"%>
String command = "hostname";
Process p = Runtime.getRuntime().exec(command);
String s =null;
DataInputStream in = new DataInputStream(p.getInputStream());
while ((s = in.readLine()) != null) {
out.println("Hostname is: " + s);
I agree. Here's the link:
subject: Getting Was node's name?
It's not a secret anymore!