Failed to connect to MDM via Java API

Hi,
I wrote a very simple application in which there is a view which
calls the component contoller. The Component Controller
connects to MDM Repository.
I think I am wrong with the calling of Component from Web Dynpro view.
As, the code resulting in no error or success.
Please suggets something.
public void getRepositoryConnection( java.lang.String hostName, java.lang.String repositoryName, java.lang.String userId, java.lang.String passWord )
    //@@begin getRepositoryConnection()
//          create connection pool to a MDM server
         String serverName = "kolapon.HCLT.CORP.HCL.IN";
         ConnectionPool connections = null;
         try{
              connections=ConnectionPoolFactory.getInstance(serverName);
         catch(ConnectionException e)
         { e.printStackTrace();
              return;
//          specify the repository to use
                           // alternatively, a repository identifier can be obtain from the GetMountedRepositoryListCommand
                       repositoryName = "KaushikRepo";
         String dbmsName ="MDM";
          RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.ORACLE);
//          get list of available regions for the repository
          GetRepositoryRegionListCommand regionListCommand = new GetRepositoryRegionListCommand(connections);
          regionListCommand.setRepositoryIdentifier(reposId);
          try{
               regionListCommand.execute();
          catch(CommandException e)
               e.printStackTrace();
               return;
     RegionProperties[] regions = regionListCommand.getRegions();
//      create a user session
      CreateUserSessionCommand sessionCommand = new CreateUserSessionCommand(connections);
      sessionCommand.setRepositoryIdentifier(reposId);
      sessionCommand.setDataRegion(regions[0]); // use the first region
     try {
                               sessionCommand.execute();
                          } catch (CommandException e) {
                               e.printStackTrace();
                               return;
     String sessionId = sessionCommand.getUserSession();
//      authenticate the user session
      String userName ="kaushikb";
      String userPassword ="taton";
      AuthenticateUserSessionCommand authCommand =
                                new AuthenticateUserSessionCommand(connections);
      if(authCommand!=null)
           wdComponentAPI.getMessageManager().reportSuccess("Success");                          
      else{
           wdComponentAPI.getMessageManager().reportWarning("Failure");
      authCommand.setSession(sessionId);
      authCommand.setUserName(userName);
      authCommand.setUserPassword(userPassword);
      try {
                                authCommand.execute();
                           } catch (CommandException e) {
                                e.printStackTrace();
                                return;
                           // the main table, hard-coded
       try{
          GetRepositorySchemaCommand getRepositorySchemaCommand = new GetRepositorySchemaCommand(connections);
          getRepositorySchemaCommand.setSession(sessionId);
          getRepositorySchemaCommand.execute();
          RepositorySchema repositorySchema;
          repositorySchema = getRepositorySchemaCommand.getRepositorySchema();
          TableId tableId= repositorySchema.getTable("MDM_BUSINESS_PARTNERS").getId();
     RecordFactory.createEmptyRecord(tableId);
     //RecordFactory.createEmptyRecord(mainTableId);
     if(tableId!=null)
          wdComponentAPI.getMessageManager().reportSuccess("It is success");
     else{
     wdComponentAPI.getMessageManager().reportWarning("Failure");     
catch(Exception ce)
ce.printStackTrace();     
//  catch(SessionException se)
//se.printStackTrace();
    //@@end
Regards
Kaushik Banerjee

Hi Jitesh,
getRepositoryConnection() is my method which does the connection.
Now, there are methods as :
getFields
public FieldId[] getFields()Get array of field IDs for all populated records.
Returns:
array of field IDs. Empty array is returned if any field was populated
getFieldValue
public MdmValue getFieldValue(FieldId fieldId)
                       throws java.lang.IllegalArgumentExceptionGet value of the specified field.
Parameters:
fieldId - field ID
Returns:
field value
Throws:
java.lang.IllegalArgumentException - if field with specified ID does not exist or was not populated
I want to use all these methods.
So, I need to declare these methods in the Controller Class and these methods will call themselves so, that I can achieve the real purpose of creating records, getting values from the field and getting field Ids etc.
Regards
Kaushik Banerjee
Edited by: Kaushik Banerjee on Apr 28, 2009 7:09 AM

Similar Messages

  • Extracting image variants for web index from MDM via Java API

    Hi There, we are currently using an open source search engine to crawl the MDM database and build indexes for our webstores nightly. In this process, we have an image extraction method using the MDM java API's. Can someone please tell me how to call an image variant into this process rather than the 'original image' stored in MDM? I've created a variant that will optimise for web conditions and we need to call this one into the webstore, not the originals that are sometimes huuuuge...

    Hi Adam,
    From MDM Documentation (can be found here [http://help.sap.com/saphelp_nwmdm71/helpdata/en/49/0505fba870404ce10000000a42189b/frameset.htm]):
    Retrieving Image Variants
    To retrieve binary data for image variants carry out these steps:
           1.      Retrieve all image variants using the RetrieveImageVariantsCommand class.
           2.      Retrieve the Image BLOB whose variants you want to get, (see Retrieving BLOB Records above).
           3.      Retrieve the BLOB for the specific image variant using the RetrieveBlobCommand.
    Hope this information helps,
    Idan

  • Extract image and Features from the Catalog via JAVA API

    Hello,
    I would like to Extract image from the Catalog via JAVA API, Can anybody help on that? I also tried to extract the Features field form the Catalog but results in the error "Features field not found" Any ideas what could have wrong?
    Many thanks,
    Dharmi

    Hello,
    Can anybody tell me where i can find the latest JAVAAPI reference guide? I found the one for MDM 5.5 SP 1 but that also refers to the last parameter of the CatalogCache.Init as int and not string.
    I looked up in service.sap.com/instguides -> SAP Netweaver -> Release 4 -> Installation and there only following 3 files are there for MDM 5.5 SP2
    MDM 5.5 SP02 - Configuration Guide  SAP MDM
    MDM 5.5 SP02 - Installation Guide   SAP MDM
    MDM 5.5 SP02 – ERP-MDM Field Mapping and Check Tables
    Regards,
    Dharmi
    Message was edited by: Dharmi Tanna
    Message was edited by: Dharmi Tanna

  • Fetching Images Via JAVA API

    Hi,
    I am trying to fetch images via Java Api.
    Please look at the code below:
    A2iValueArray imgs1 = null;
    for(int y=0; y<rs1.GetRecordCount(); y++){
         imgs1 = rs1.GetValueAt(y,"Product_Image").GetValueArray();
    It is throwing me a Class cast exception.
    I also tried
    imgs1 = (A2iValueArray) rs1.GetValueAt(y,"Product_Image").GetValueArray();
    but to no avail...
    I am using MDM Sp04..
    Please guide me...

    This Code Worked for me:
              try {     
              A2iResultSet rs1 = catalogData.GetResultSet(search, rsd, null, true, 0);
               A2iValueArray imgs1 = new A2iValueArray();
                   for(int y=0; y<rs1.GetRecordCount(); y++){
                        if(!rs1.GetValueAt(y, "Images").IsNull()){
                        imgs1 = rs1.GetValueAt(y,"Images").GetValueArray();
                        int id = imgs1.GetValueAt(0).GetIntValue();
                        //int id = rs1.GetValueAt(0, "Product_Color").GetIntValue();
                        String imagePath = catalogCache.GetImagePath("Products", id);//"Thumbnail" ,
                        //wdComponentAPI.getMessageManager().reportWarning("Your image is at: " + CACHE_DIRECTORY + "\" + imagePath);
                        System.out.println("imagePath="+imagePath);
                        break;
                   catalogData.Logout();
              } catch (StringException e) {
                   e.printStackTrace();
    Posting your program may help troubleshoot.
    Venkat

  • How to call business rules scripts via Java API

    Hi
    I have a problem. I have some scripts (business rules in essbase) that can be seen thru Administration Services Console under Business Rules folder. How can I execute these script using Provider Services (via Java API to EssBase interface)?

    hi
    i look too java api sample for "HBR Lounch"
    you can try found example in EAS folder
    C:\Hyperion\AdminServices\AppServer\InstalledApps\Tomcat\5.0.28\eas\webapps\hbrlauncher\MC_LaunchWindow.jsp
    please back, if you will have resolution :)

  • Error in MDM - EP integration  : "Failed to connect to MDM server. ....."

    Dear SDN,
    I m in middle of configuring the MDM and EP integration.
    <u>EP Version Info :</u>
    J2EE Engine 6.40 PatchLevel 108290.313
    Portal 6.0.20.0.0
    BP has been installed.
    We are able to view MDM system and MDM search IViews in the Wizards in the portal.
    <u>MDM Version Info</u> : MDM  5.5  SP 04
    I come across the following error :
    <b>Step 4:  An error has occurred
    Failed to connect to MDM server. Check your system. The server may be down or there may be an error in one or more of your system parameters.</b>
    System parameters are Server name and pwd .
    This parameters are used to start the server and pwd for accessing the server while mounting the server.
    Also at the same time, my MDM server is running and repository is shown loaded and running.
    Kindly suggest what should have been missed out from our side or some way we can make sure that error does not occur.
    Please help.
    Regards,
    Chandani Shah.

    Hi Chandani,
    in Portal clik on Personalization, and in User Mapping you need to map the MDM repository user (may be Admin)..... then try another time.
    Please, check the BP version in order to unserstand if it is the rigjt version for your MDM.
    Hoper this help you.
    Regards,
    Vito

  • Search for a Multilingual value in MDM using JAVA API

    Good day,
    Could you kindly assist.
    I am trying to search for a field in MDM, from Portal using JAVA API. I do retrieve the value in English, but the problem is when I am trying to retrieve it in other languages. Please see sample code:
         private Search getSearch(MDMConnection mdmconnection,String value, TableId tableid){
              Search search =null;
              FieldSearchDimension fielddimension=null;
              TextSearchConstraint textcontrain=null;
              RepositorySchema reposchema =mdmconnection.reposchema;          
                                               if(value!=null)
                   search= new Search(tableid);
                   fielddimension=new FieldSearchDimension(reposchema.getFieldId("ATTR_VAL_ABBR","TEXT_VALUE"));
                   textcontrain=new TextSearchConstraint(value,TextSearchConstraint.EQUALS);
                   search.addSearchItem(fielddimension,textcontrain);
                   search.setComparisonOperator(Search.AND_OPERATOR);
              return search;
    Thank you in advance.
    Regards,
    Simni

    Hi ,
    Mdm- Multilingual value in MDM using JAVA API:
    you can check the first point as its reagrdign youisue related pdf and soloutions for your question.
    1.  http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e8aedc-cdfe-2c10-6d90-bea2994455c5?QuickLink=index&overridelayout=true
    2.  http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e8aedc-cdfe-2c10-6d90-bea2994455c5?QuickLink=index&overridelayout=true
    Hope this information helps you in solving the  issue!!
    Thanks&Regards
    AswinChandraGirmaji

  • How to retrieve data from MDM using java API

    hi experts
    Please explain me the step by step procedure
    how to retrieve data from MDM using java API
    and please tell me what are the
    important classes and packages in MDM Java API
    thanks
    ramu

    Hi Ramchandra,
    You can refer to following links
    MDM Java API-pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49
    webinr of java API
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/89243c32-0601-0010-559d-80d5b0884d67
    Following Fourm Threads will also help.
    Java API
    Java API
    Re: usage of  java API ,
    Matching Record
    Need Java API for Matching Record
    Thanks and Regards,
    Shruti.
    Edited by: Shruti Shah on Jul 16, 2008 12:35 PM

  • Req. Sample code for the Updation of Master record in MDM using Java API..

    Hi All,
    Can anyone provide me the same code for Updation of master record in MDM using Java API ??

    Hi SakthiNarayananD,
    You can additionally go through the following links to work with MDM and Java API:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49  (Java API)
    http://help.sap.com/javadocs/MDM/SP05/(Java api programs)
    https://help.sap.com/javadocs/MDM/current/index.html  (java api codes)
    http://help.sap.com/javadocs/MDM/SP06P2/index.html (Java Docs for SP06)
    Reg: Using JAVA API - Search
    Re: Retrieving Drop Down List Value using JAVA API - Lookup values
    How to retreive records from Lookuptable of type flat - Lookup Values
    Reg: MDM with webdynpro - READ,INSERT,MODIFY
    Hope It Helped
    Thanks & Regards
    Simona Pinto

  • Modifying record in MDM using JAVA API

    hello all
    I have created record in MDM using JAVA API now I want to update record using API. I used ModifyRecordCommand. But this requires input as Record but I have RecordID of the record to be modified. How do I get Record value from RecordID.

    Hi,
                      You can use RetrieveRecordsByIdCommand to get the record by Record Id.
                RetrieveRecordsByIdCommand recordbyidcom = new  RetrieveRecordsByIdCommand(con);
                recordbyidcom.setSession(session);
                recordbyidcom.addId(recordid);
                recordbyidcom.setResultDefinition(resultdefinition);
                recordbyidcom.execute();
                RecordResultSet rs = recordbyidcom.getRecords();
                Record record = rs.getRecord(0);
                //Modify the record
                record.setFieldValue(fieldid,value);
                ModifyRecordCommand modify = new ModifyRecordCommand(con);
                modify.setSession(session);
                modify.setRecord(record);
                modify.execute();
    Regards,
    Sreenivasulu Thimmanapalli.
    Edited by: Sreenivasulu Thimmanapalli on Dec 8, 2008 2:36 AM

  • Need to transfer files using sftp via java api's.

    Hi,
    I got a requirement to transfer files using sftp via java api's.
    Kindly specify any 3rd party Java Libraray to do this.
    The requirements are
    -It must support extensive encryption algorithms.
    -It must allow generating public/private keys and authenticating with server by sending the keys first(before the actual file transmission).
    Thanks.

    Don't resurrect old threads, please. Start your own thread.
    Better yet: google for "Java SFTP", look at what you find and come back when you have a specific question.
    And: when you ask a specific question, then clarify if you're talking about the [SSH file transfer protocol|http://en.wikipedia.org/wiki/SSH_file_transfer_protocol] or about FTPS, which is sometimes (wrongly) called SFTP.

  • Connecting to Shared Services via java API

    Hello All -
    I am new to using Shared Services and I would like to know how to connect to Shared Services using a java API. We are using release 11.1.1.2 and I have found and read the documentation on how to maintain users and groups. The examples in the documentation demonstrates how to the task but assumes you have already connected to shared services or you know how to connect. Any help will be appreciated.
    Keep in mind this is not an Essbase connectivity question but shared services.
    Thanks

    Sorry double post

  • Problems adding WFS layer via Java API

    Hi
    I am trying to add a WFS layer to my map via the java api. There is little documentation on this and I am struggling a bit, I wonder if anyone has done the same? The call I am developing looks like:
    mapViewer.addWFSTheme("devprop",
    "WFS",
    "http://cjones:8080/geoserver/wfs?",
    "EPSG:27700",
    "ST_Building",
    "the_geom",
    "building",
    "ID",
    attributeList,
    renderStyleAttributes,
    featIds
    but the mapviewer log states:
    Jun 30, 2011 4:03:47 PM oracle.sdovis.util.WfsCapabilities readUsingHttpGet
    INFO: GetCapabilities request: http://cjones:8080/geoserver/wfs?VERSION=1.0.0&SERVICE=WFS&REQUEST=GetCapabilities
    Jun 30, 2011 4:03:47 PM oracle.sdovis.util.WfsCapabilities decodeCapabilities
    SEVERE: Decode GetCapabilities failed: null
    Jun 30, 2011 4:03:47 PM oracle.sdovis.theme.WFSThemeDefinition readCapabilities
    WARNING: Unable to get Capabilities for url: http://cjones:8080/geoserver/wfs?
    Jun 30, 2011 4:03:47 PM oracle.sdovis.DBMapMaker renderEm
    INFO: **** time spent on loading features: 172ms.
    Jun 30, 2011 4:03:47 PM oracle.sdovis.RenderingEngine prepareForRendering
    FINEST: xfm: 3.0236220472436512 0.0 0.0 -3.0236220472436512 -1047236.0393699252 532885.8661416543
    Jun 30, 2011 4:03:47 PM oracle.sdovis.VectorRenderer render
    FINER: time to render theme WFS with 0 styled features: 0ms
    Jun 30, 2011 4:03:47 PM oracle.sdovis.VectorRenderer label
    FINER: time to label theme WFS with 0 styled features: 0ms
    Jun 30, 2011 4:03:47 PM oracle.sdovis.DBMapMaker renderEm
    INFO: **** time spent on rendering: 0ms
    if I goto http://cjones:8080/geoserver/wfs?VERSION=1.0.0&SERVICE=WFS&REQUEST=GetCapabilities via the browser I get:
    <WFS_Capabilities version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://cjones:8080/geoserver/schemas/wfs/1.0.0/WFS-capabilities.xsd">
    +<Service></Service>
    +<Capability></Capability>
    +<FeatureTypeList></FeatureTypeList>
    +<ogc:Filter_Capabilities></ogc:Filter_Capabilities>
    </WFS_Capabilities>
    Any pointer appriciated
    Thanks
    Chris

    If the getcapabilities result is:
    <WFS_Capabilities version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://cjones:8080/geoserver/schemas/wfs/1.0.0/WFS-capabilities.xsd">
    +<Service></Service>
    +<Capability></Capability>
    +<FeatureTypeList></FeatureTypeList>
    +<ogc:Filter_Capabilities></ogc:Filter_Capabilities>
    </WFS_Capabilities>
    then it's empty and there are no features to be served up.
    Test the WFS service in mapbuilder first.

  • Access to Attribute Type via Java API

    Hi,
    I'm writing an aplication in Java to access out OLAP schema and display certain DIMENSION/LEVEL and ATTRIBUTE values. This is working out really well but I'm hitting one issue at the moment which has me stumped.
    When I display a Dimension value in a table I want to default the attribute we display to a sensible display value. In AWM there is a field "Attribute Type" which offers drop down selections for "User", .... "Member Short Description", "Member Long Description"...
    See the General Tab under Attributes for a particular Attribute. Looking at the Help text for the "Member Long Description" I see the following.
    "Long descriptive names typically used by Oracle Business Intelligence tools for displaying dimension members in selection lists, crosstabs, and graphs." Looks perfect for what I want. My Dataware house architect already has an Attribute for each hirearchy
    marked with this property so in theory I should be able to look for the Attribute in the Dimension with this property and bingo I have my default display Atttribute!
    The problem is I seem to be able to find api's to access every aspect of the MdmAttribute object except this particular property.
    Here is a snippet from the OLAP api sample code augmented with some println's of my own:
    if (mdmAttr.getName().equals(name)) {
         System.out.println("Attribute : " + mdmAttr.getID());
         System.out.println(" name : " + mdmAttr.getName());
         System.out.println(" desc : " + mdmAttr.getDescription());
         System.out.println(" s desc: " + mdmAttr.getShortDescription());
         System.out.println(" type : " + mdmAttr.getType());      
         System.out.println(" type id: " + mdmAttr.getType().getID());
    return mdmAttr;
    None of the avaiable APIs of MdmAttribute seem to fit the bill.
    The question is ... is there an API somewhere I can call on the MdmAttribute object or an associated object that will give me back the "Attribute Type" as listed in this dropdown. Note that getType returns DataType!String which denotes the fundemental type of the Attribute (int, String etc) rather than this abstract Attribute Type property we need. Not listed here is the getDataType() api which also returns DataType!String and seems to be equivalent to the getType api.
    Regards
    Fergal

    One small clarification if its not already obvious. We are using the OLAP Java api's directly ... not via BI Beans.
    Regards
    Fergal

  • Connecting to Oracle using Java API

    I'm fairly new to Oracle, but what I'm trying to do should be straight forward (at least that's what I thought). I'm simply trying to connect to an Oracle database using the latest java API (J2SE 1.4.1).
    I downloaded JDBC OCI (type 2) driver form the Oracle Web site along with the appropriate DLL; however when I try to run the following two lines
    String dbUrl = "jdbc:oracle:oci8:@test";
    String user = "user";
    String password = "password";
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection c = DriverManager.getConnection(dbUrl, user, password);
    I get the following error message:
    "java.exe - Entry Point Not Found
    The procedure entry point slzsetevar could not be located in the dynamic link library oracore8.dll."
    Please note that I am running under Windows 2000 Pro, have Oracle Client 8.1.5 installed, and am able to connect to the same Oracle database using ODBC and PowerBuilder native drivers.
    Then I read somewhere that I should use 8.1.7 version of the Oracle client software, so I downloaded it from the Oracle Web site. However when I try to install it under Windows 2000 (by double-clicking on the setup.exe) nothing happens!!!
    Any ideas?!

    Sorry, I should have been more specific. The error message I was referring to shows up in a pop-up windows when I try to run the program. The actual java error message (that shows up in the command prompt window) is as follows:
    "Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\WINNT\system32\ocijdbc8.dll: The specified procedure could not be found
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:832)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:192)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:142)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:214)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:193)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at lookup.main(lookup.java:16)"
    I'm running the program through Windows 200 Pro command prompt, and the version of java is, as I mentioned in the previous message, 1.4.1:
    java -version
    java version "1.4.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
    Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

Maybe you are looking for

  • Im running lion 10.7 and just upgraded itunes 10.6.1 and every time i open itunes it errors... What why?

    This is what the error shows: Process:         iTunes [983] Path:            /Applications/iTunes.app/Contents/MacOS/iTunes Identifier:      com.apple.iTunes Version:         10.6.1 (10.6.1) Build Info:      iTunes-10610701~1 Code Type:       X86-64

  • Iphone stuck on iTunes logo, not recognized by Mac.

    Yesterday my phone was connected to iTunes to do an update but there was a loss of power mid update and the phone got stuck on the iTunes logo screen.  At the time the battery level was at 1%.  I left the phone 'charging' overnight, although I can't

  • Goods receipt for purchase order is not allowed

    Hi, When I am doing the PO receipt i am facing the error message "Goods receipt for purchase order is not allowed WBS element xxxxxx" What could be the problem Thanks Lucky

  • Nokia Suite/Nokia Store finally working

    I had not tried downloading/installing an app from the Nokia store from within Nokia Suite in quite a while, as it never seemed to work. On a lark, I decided to see whether anything had changed since installing the latest version of Nokia Suite. To m

  • Re : Dynamic instanciation

    Manuel, The only way to do a dynamic insantiation of a class using a string is to use dynamic libraries in R3. You will probably also need to create a Forte interface for the object you want to instantiate. Here is an example to get an idea: myClassN