Thursday, January 11, 2018

Exception : this is only psuedo object

Today , i have faced this error when i try to deploy SOA composite to the server from jdeveloper . where the deployment process is failed and i have received this exception in the jdeveloper window log , to overcome this issue i did some searches to find out solution and i found useful link here .

In the above link it suggest that reason of this error is the mismatch between WSDL url in composite and BPEL where one is pointing to server while other to MDS .

however, in my case the problem was removing SOAP component from composite without removing the in\out variables of Invoke after removing the INOKE itself .

when i deleted the variable everything worked and the composite is deployed .  

Saturday, July 22, 2017

Consuming SSL Web service with certificate using oracle SOA 12c

lately , we have received WSDL from client with SSL and certificate and we try to consume this  web service we have faced the following exception :

javax.xml.ws.WebServiceException: javax.net.ssl.SSLKeyException: Hostname verification failed

we quick solve this issue by the following steps :

Servers -> server name -> Configuration SSL tab -> Advanced -> Change Hostname Verification dropdown to None

then we face this exception :
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
our understand was , we need to import certificate into weblogic keystror and  to do that we went to keystrore tab in weblogic to get the path of trust store and we surprised because the concept in 12c is different about 11g . in 11g you will see physical paths while in 12c became urls .

after some research we understood that we have to add the certificate to system\trust keystore from em



but the error did not change so we back to 11g concept and we try . the steps as follow :


  • create key store using keytool
  • import Root,intermediate,client certificate to this key store
  • adding this commands to file set domainenv                                                                                        set JAVA_OPTIONS=%-Djavax.net.ssl.trustStore=fullpath -Djavax.net.ssl.trustStorepassword=yourpassword
  • restart weblogic
and that's all !

Note : after we finish this solution we discovered oracle link that may help to solve first solution issue by the following :


  1. Open FMW_HOME/user_projects/domains/WLS_SOA/bin/setDomainEnv.sh.
  2. In EXTRA_JAVA_PROPERTIES:
    Replace:
    • -Djavax.net.ssl.trustStore=%WL_HOME%\server\lib\DemoTrust.jks
    With:
    • -Djavax.net.ssl.trustStore=kss://system/trust -Djavax.net.ssl.trustStoreType=kss

but i did not try it so i strongly advice to try this first before go to 11g approach .


Note2 : a i did not include keytool commands to create keystore and import certificate because it's available everywhere .



finally , i would like to thank my colleague Mohannad click here for his support .






Saturday, February 18, 2017

Integration with Knet Payment Gateway - Pin Pad Device

in this article series i will suggest way to control Pinpad Device (payment through device) from ADF application . the story started when we received java Api (jar) from knet payment Gateway (Kuwait payment gateway ) , with target to implement it through ADF application .

first approach was implementing it using java applet which not worked because java Applet became out dated . we looked to alternative solutions but we failed .

later , we found implementation using windows service (hosting Wcf over windows Service) but the challenge still exist because we don't have dll . so we converted the jar to dll .  

the proposed solution have the following steps :

  1. Convert jar to dll (to convert library from java technology to .net)
  2. develop WCF Service (rest) over windows 
  3. import the Dll and execute the payment process through web operation
  4. run and start windows Service
  5. call the service from java script
Below the details :

conversion library from jar to dll :
we searched a lot to find the appropriate too to do this task . until we found ikvm tool which enable you to convert your jars to dlls and exe (check this)  after downloading and unzipping it you can execute this task using the following command line :

ikvmc your jar.jar

after execution you will find your dll in the same directory , did you find it ? good job 😏
now let us go to the next step .

 Hosting WCF on windows service :
this approach suggested by Microsoft to host web services on end user PC with full privileges to access user resources and hardware check this.

  Create java script Caller :

in this part i will show how to create java script code that should be used to call Rest service that hosted on ADF application  . below sample for it .

<script type="text/javascript">
       function test() 
             {
                var xhttp = new XMLHttpRequest();
                xhttp.open("POST", "http://localhost:8000/ServiceModelSamples/service/knetPayment",                     true) ;
               xhttp.setRequestHeader("Content-type", "application/json");
               
                xhttp.onload = function (e) 
                   {
                      if (xhttp.readyState === 4) 
                           {
                              if (xhttp.status === 200) 
                                       {
                                           alert(xhttp.responseText);
                                        } 
                              else 
                                        {
                                           alert(xhttp.statusText);
                                         }
                               }
                     };
              xhttp.onerror = function (e) 
                    {
                       alert(xhttp.responseText);
                    };
              xhttp.send('{"Amount":"10"}');
              alert("3");
           
         }



    </script>


Enjoy !

Wednesday, November 23, 2016

Create OID User using java SDK

in this article i gonna show java code sample that explain how to create user in OID grammatically .
before taking the code you have to do the following two steps :

  1. Create custom project 
  2. add reference for the following jar ldapjclnt11
now Create Class and copy the following code :


import oracle.ldap.util.*;
import oracle.ldap.util.jndi.*;
import javax.naming.NamingException;
import javax.naming.directory.*;
import java.io.*;
import java.util.*;





public class OIDConnect {
    public OIDConnect() {
        super();
    }
    
    final static String ldapServerName = "xx.xx.xx.xx";
    final static String ldapServerPort = "3060";
    final static String rootdn = "cn=orcladmin";
    final static String rootpass = "password";


    public static void main(String[] args) throws NamingException {
       
       
        // Create the connection to the ldap server
        InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx(ldapServerName, ldapServerPort, rootdn, rootpass);

        // Create the subscriber object using the default subscriber
        Subscriber mysub = null;
        String[] mystr = null;
       
        try 
            {
                RootOracleContext roc = new RootOracleContext(ctx);
                mysub = roc.getSubscriber(ctx, Util.IDTYPE_DN, "dc=xx,dc=xx,dc=xx", mystr);
                              
            
              
            } 
        catch (UtilException e) {
            e.printStackTrace();
        }

        // Create ModPropertySet 
        ModPropertySet mps = new ModPropertySet();
        
        
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "cn", "John");
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "sn", "John");
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "objectclass", "person");
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "objectclass", "organizationalPerson");
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "objectclass", "inetOrgPerson");
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "objectclass", "orclUser");
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "objectclass", "orclUserv2");
        
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "givenname", "John");
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "userPassword", "xxx");
        mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD, "uid", "John");

        // Create the user
        User newUser = null;
        try {
            newUser = mysub.createUser(ctx, mps, false);
            
        
            System.out.println("New User DN: " + newUser.getDN(ctx));
        } catch (UtilException e) {
            e.printStackTrace();
        }
    }


      
        
   
}


Wednesday, October 26, 2016

Workaround To Prevent user from inserting Filename without Extension in UCM Attachment Dialog

in this article i'am going to show you a workaround that may be useful to deal with Extension issue that appear when integrate UCM with BPM .

as you may know when you check use package checkbox in human task(document tab) and before that you were did the required configuration to integrate BPM and UCM(such as defining credentials and UCM IP in workflow properties) the attachment Dialog in pages will appear with extra fields such bellow :


when use fill the data form and then he click OK, the dialog will disappear and the file will be added to table of files which exist at the bottom of page . but the name of link will be like the value of name field in popup above  and without extension this means that user will get undetermined extension file and when he try to download it ,  the file will not be opened in the proper application directly instead of  it's need manual work to associate it with suitable software such as word ..etc using open With and that will cause a headache for users specially those with low computer skills .

To work around this issue i have added regex validator  to input Text to control the input and prevent filenames without real extensions . the solution is sound simple but actually it's take some efforts to catch . such as any other customization for BPM workspace .

Please follow the steps below :
  •  Go to similar path on your server  C:\Users\alaayacoub\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\DefaultDomain\servers\DefaultServer\tmp\_WL_user\oracle.soa.worklist.webapp\km13lp\WEB-INF\lib

  •  Open jar adflibWorklistComponents in winrar
  •  Copy page manageDocuments.jspx outside and open it
  •  Search for inputtext with name “dc_it1” which used for all inputtexts on Dialog using Foreach
  •  Replace the Input text with following block

<af:switcher facetName="#{def.propertyDef.id != 'dDocTitle' and  def.propertyDef.id != 'cmis:name'}" defaultFacet="true" id="dc_s88777">
                                    <f:facet name="true">
                                                <af:inputText label="#{def.displayName}" value="#def.providedValue}"
                                                                                          contentStyle="width:200px" columns="35" visible="#{def.visible}"
                                                                                          required="#{def.required}" readOnly="#{def.updatability eq 'READONLY'}" id="dc_it1"/>
                                    </f:facet>
                                    <f:facet name="false">
                                                <af:inputText label="#{def.displayName}" value="#{def.providedValue}"
                                                                                          contentStyle="width:200px" columns="35" visible="#{def.visible}"
                                                                                          required="#{def.required}" readOnly="#{def.updatability eq 'READONLY'}" id="dc_it_name">
                                                            <f:validateRegex pattern="([^\\s]+(\\.(?i)(doc|csv|pdf|xlsx))$)"   />
                                                </af:inputText>
                                    </f:facet>
                        </af:switcher>

  •        The goal of above code is 2 things
a.       Separate the name inputtext from others and give him special manipulation
b.      Add Validate Regex to validate Filename and extension on it

  • .       Replace adflibWorklistComponents jar with updated on Lib folder
  • .       Restart is not required

Thursday, September 29, 2016

implementing Sql Authenticator to secure Weblogic , ADF and BPM workspace in 12. 2.1

Sql Authenticator is a weblogic provider that used to enable users stored in databases to login to weblogic console , EM. in addition to use it to authenticate users in ADF stand-alone applications and BPM workspace (using workaround was valid in 11g) .

in 2008, Edwin Biemond wrote very nice article that explain how to implement SQL Authenticator , you can find here here . before few days i have applied this steps in 12.2.1 environments with minor modification . so please pay attention for the Tips below before you go to original article .

  • in  12c Groups names for Sql authenticator should be typical to that already defined in default authenticators . groups such as "administrators", "AdminChannelUsers" ...etc , should be added to the table "JHS_ROLES" and keep in mind that column "Short_Name" is sized with only 10 which not enough for Default authenticator groups , for that please consider to change it to 100
  • Standalone ADF application which deployed on weblogic can be authenticated using Database users without any extra efforts
  • the bad news is about using those users to login BPM workspace by implementing the workaround that specified here and here . this solution was valid in 11g but it's not supported any more based on oracle response to my SR which opened regarding this matter before couples of days  ! 
the error that you will receive as below :

The configured Identity Store provider "oracle.security.jps.internal.idstore.generic.GenericIdentityStoreProvider" is not supported by IDM IdentityDirectory     

to login to BPM workspace using users stored in database you have to use OVD                                                                                                        

Saturday, September 10, 2016

How database Adapter Deal with procedures that use Cursors

in this article i gonna take you in short tour to show the way that database adapter manipulate with procedures that use Cursors .

through this article i will explain small BPM example starting from Timer and call Procedure and based on outputs it will raise some human tasks .

first of all, please see the structure of BPM notation :

simply this notation start every cycle (one day in my case ) and call the procedure "GET_COOPS_NOTIFY_YST" to get the group of users that meet the condition spicified the procedure "the remaining days for their end of financial year is 30 days or less " below is the procedure that search for that condition :


create or replace PROCEDURE "GET_COOPS_NOTIFY_YST"
(
  Num_Days IN NUMBER
, prodCur OUT SYS_REFCURSOR
) AS
BEGIN
OPEN prodCur FOR SELECT * FROM USERS  where (to_date( sysdate,'DD-MM-YYYY') - to_date( Fiscal_year_date,'DD-MM-YYYY')) > Num_Days;
END;

the output of this procedure in the Service Activity appeared as 2-dimensional array : rows and columns

the table "users" assumed to be like this :
once record has been returned , simple count check will be fired to make sure that procedure has returned rows and if count >0 the next step will be start to take confirmation from manager to send the notifications to users and if he clicked "APPROVE" the notification will be sent.

to keep the loops moving on i have added 3 scripts :
  1. increase Rows : responsible to increase the variable iRows by 1 and reset the value of icols to it initial value
  2. increase Columns :responsible to increase the variable icols by 1
  3. Set Username : responsible for set value of username to usercoop field which will be set later to FYI notification letter human task .



final check is responsible to exit from loops when irows value exceed count of rows to avoid the index out of range exception .

hope you find this article is useful for you !