cancel
Showing results for 
Search instead for 
Did you mean: 

Get server name / node number in a Web Dynpro application

christof_reich
Employee
Employee
0 Kudos

Hi,

can anyone tell me how I can retrieve server name / node number in a WD application?

( something similar like it is done here

/people/michael.nicholls/blog/2006/06/21/which-portal-server-node-am-i-running-on

for a portal application)

My application is running on a WAS without a portal.

Regards

Christof

Accepted Solutions (1)

Accepted Solutions (1)

former_member182374
Active Contributor
0 Kudos

Hi,

The code in the blog is pure java code, meaning it will work for WD.

Try the following code for displaying all system keys and values (the keys/values should contain what you're looking for)

Enumeration enum = System.getProperties().keys();
while (enum.hasMoreElements()) {
  String prop = (String) enum.nextElement();
  wdComponentAPI.getMessageManager().reportSuccess(prop + "--> " + System.getProperty(prop));
}

BTW,

SLD & J2EE are not always the same machine, it depends on your configuration.

Omri

Answers (3)

Answers (3)

christof_reich
Employee
Employee
0 Kudos

Hi,

thanks for your replies.

I guess I can get via

System.getProperties().keys();

the key SAPINFO that contains the information I need.

Regards

Christof

Former Member
0 Kudos

Hi,

Go thru this link this might helps you .

Thanks,

Lohi.

Former Member
0 Kudos

You can obtain the cluster name as follows

WDSystemLandscape.getCurrentJ2EEClusterName());

or

WDSystemLandscape.getSLDHost();

WDSystemLandscape.getSLDPort();

or

This is what i do to find the current server the application is running on.

WDDeployableObjectPart d = wdComponentAPI.getDeployableObjectPart();

try{

String url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getApplication().getDeployableObjectPart());

wdContext.currentContextElement().setHostName(url.substring(0,url.indexOf("/", 7)));

}catch(WDURLException e){

}

The above code sets the context element with the current hostname for example,

http://hostname:port/

Most of the times the rest of the url for uwl should be similar across all application servers, which could be concatenated to the above path.

Hope this helps

Peace