cancel
Showing results for 
Search instead for 
Did you mean: 

Using IClusterInformation Interface to get the server node.

Former Member
0 Kudos

Hi ,

I have created a portal application which contains an Abstract Portal Component to display the server node the user logs on.

I have written the following code :

IClusterInformation clusterContext =

(IClusterInformation) PortalRuntime.getRuntimeResources().getService( IClusterInformation.KEY);

I too added the Sharing Reference , "com.sap.portal.runtime.system.clusterinformation" to Application Config property in Portalapp.xml file.

But still am getting an error "IClusterInformation cannot be resolved".

Do I need to add some external JAR File to the Java Build Path of my portal Application. If so , Which JAR file I need to add?

Regards,

Eben Joyson.

Accepted Solutions (1)

Accepted Solutions (1)

former_member206159
Active Contributor
0 Kudos

Hi,

I think you also need the com.sap.portal.runtime.system.clusterinformation_api.jar file to be imported in your project.

Hope that helps you.

Raghu

Former Member
0 Kudos

Hi.,

Thank you for your reply. Where do i can download the jar file?

former_member206159
Active Contributor
0 Kudos

Hi,

You can get it from the portal server in the below path

.../JC01/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/deployment

Raghu

Answers (1)

Answers (1)

Former Member
0 Kudos

I use this to get the server - node:


String node = "";
Enumeration props = System.getProperties().keys();

while (props.hasMoreElements()) {
  String thisProp = props.nextElement().toString();

  if (thisProp.startsWith("dsr.") && thisProp.endsWith(".buffersize")) {
    node = thisProp.substring(5 + thisProp.indexOf("_" + SID + "_"), thisProp.indexOf(".buffersize"));
      if (node != null) {
        String cluster = node.substring(0, 6) + "00";
        node = node.substring(0, 8);
      }
  }
}

Hope it helps

Johannes