Wednesday, 28 October 2015

DB based MDS and adf-config.xml

Version 11.1.1.6 & 7

JDeveloper can be used to connect to DB based MDS. The steps to create DB based MDS are -


  1. Create DB connection to DEV_MDS.
  2. Create MDS connection (DB based) while selecting the db connection created in first step.
  3. Add that MDS connection to the repository and you are ready to refer the artifacts from DB based MDS.


Sometimes if adf-config.xml is not correct you may face below error while opening the application.

Error: oracle.fabric.common.FabricException: oracle.mds.config.MDSConfigurationException: MDS-01330: unable to load MDS configuration document 

MDS-01329: unable to load element "persistence-config"
MDS-01370: MetadataStore configuration for metadata-store-usage "mstore-usage_2" is invalid. 
MDS-00011: unable to create configuration object or MDSInstance due to invalid configuration information: oracle.mds.exception.MDSException: MDS-01373: unable to retrieve password. 
MDS-01373: unable to retrieve password.



Make sure that mstore-usage is defined correctly. Pasting the correct adf-config.xml here -
<metadata-namespaces>
          <namespace path="/deployed-composites/default"
                     metadata-store-usage="mstore-usage_2"/>
          <namespace path="/soa/shared" metadata-store-usage="mstore-usage_3"/>
        </metadata-namespaces>
        <metadata-store-usages>
          <metadata-store-usage id="mstore-usage_2">
            <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
              <property name="jdbc-userid" value="DEV_MDS"/>
              <property name="jdbc-password" value="password"/>
              <property name="jdbc-url"
                        value="jdbc:oracle:thin:@<ipaddress>:<port>:<SID>"/>
              <property name="partition-name" value="soa-infra"/>
            </metadata-store>
          </metadata-store-usage>

Friday, 9 October 2015

Decoding Base64 Encoded data using Java Embedding Activity

Recently faced critical issue while decoding Base64 encoded data.After doing lot of R&D finally achieved it by using Native Java Code.

Here are the step to step  process to achieve the same.
  1. Created String variable with the name "MyRowIDVar".
  2. Copied  Base64 encoded data into MyRowIDVar variable using Assign activity.
  3. Drag & Drop Java Embedding activity in middle of Bpel process and added below java code snippet in it.                                                              String rowid = (String)getVariableData("MyRowIdVar");       
    Base64Decoder Decoder = new Base64Decoder();   
    try                                          
     {             
        String decodedAmpersand = Base64Decoder.decode(rowid);  
        setVariableData("AA",Base64Decoder.decode(rowid));        
     }                                          
    catch(Exception e)                                          
     {                                          
        e.printStackTrace();                                           
     }
  4. we need to import required classes into bpel code  as shown below.
     <bpelx:exec import="oracle.soa.common.util.*" />
     <bpelx:exec import="java.lang.*" />
  5. When you open Bpel source code it should be looking like this.                            <bpelx:exec     import="oracle.soa.common.util.*"/>
    <bpelx:exec import="java.lang.*"/>
    <bpelx:exec name="DecodeBase64" version="1.5" language="java">
          <![CDATA[String rowid = (String)getVariableData("MyRowIdVar");       
       Base64Decoder Decoder = new Base64Decoder();   
       try                                          
       {             
          String decodedAmpersand = Base64Decoder.decode(rowid);  
          setVariableData("
    MyRowIdVar",Base64Decoder.decode(rowid));        
       }                                          
      catch(Exception e)                                          
      {                                          
        e.printStackTrace();                                           
      }]]>
    </bpelx:exec>
  6.  Finally in MyRowIdVar variable having Decoded Base64 data which can be processed further as per the requirement.
  7. Below are few screen shots for the reference.   
Keep Smile, Happy Coding..:)