Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Java access to SLD's DBs gives error

I want to retrieve the list of HANAs registered in SLD, but got into an error. What I have done incorrectly?

Wonder is there API docs, sample codes somewhere for the Java WBEM client?

-----------------------------------------------------------------------------------------------------------------------------------

import com.sap.lcr.api.cimclient.CIMClient;

import com.sap.lcr.api.cimclient.CIMOMClient;

import com.sap.lcr.api.cimclient.ClientFactory;

import com.sap.lcr.api.cimclient.HttpRequestSender;

import com.sap.lcr.api.sapmodel.*;

URL url = new URL("http://SERVER:PORT/sld/cimom");

HttpRequestSender requestSender = new HttpRequestSender(url, 'user', 'password');

CIMOMClient cimomClient = new CIMOMClient(requestSender);

CIMClient cimClient = new CIMClient(cimomClient);

// Retrieve list of Message Servers

SAP_BCMessageServerAccessor msgAccessor = new SAP_BCMessageServerAccessor(cimClient);

SAP_BCMessageServer[] msgServers = msgAccessor.enumerateSAP_BCMessageServerInstances();                  // Works

// Retrieve list of Application Servers

SAP_BCApplicationServerAccessor appAccessor = new SAP_BCApplicationServerAccessor(cimClient);

SAP_BCApplicationServer[] appServers = appAccessor.enumerateSAP_BCApplicationServerInstances();              // Works

// Retrieve list of DBs

SAP_DatabaseSystemAccessor dbAccessor = new SAP_DatabaseSystemAccessor(cimClient);

SAP_DatabaseSystem[] dbSys = dbAccessor.enumerateSAP_DatabaseSystemInstances();          // Error - ErrorCIM_ERR_FAILED: Failed to create a JavaCIMObject from a CIMInstance for target class: SAP_HDBSystem

Tags:
Not what you were looking for? View more on this topic or Ask a question