Search Results

Tuesday, November 29, 2016

Import certificates using keytool


One of the import step to call an https webservice using java is to import the SSL certificates before initiating a call.

This example shows the certificates imports on a default weblogic certificates path. However this could be different on your weblogic server, so make sure the path is checked before installing the certificates.

cd /u01/app/oracle/products/jdk1.8.0_66/bin

./keytool -import -keystore /u01/app/oracle/products/fmw1213/wlserver/server/lib/DemoTrust.jks -alias salesforcecom_test -storepass DemoTrustKeyStorePassPhrase -file ~/SalesforceCert.cer

keytool -list -keystore /u01/app/oracle/products/fmw1213/wlserver/server/lib/DemoTrust.jks -storepass DemoTrustKeyStorePassPhrase -alias salesforcecom_test

Notepad++ plsql function list

Locate functionList.xml file on the Notepad++ install location.

Add association map

<association langID="17" id="sql_node"/>

And the following parser

<parser id="sql_node" displayName="SQL Node" commentExpr="((/\*.*?\*)/|(--.**$))">
                  <nameExpr expr="^[\s]{0,}(function|procedure|--[1-9])[\s]{1,}\K[\w_]{1,}"/>

And finally restart the Notepad++

Now enable View -- FunctionList

This should bring you list of all functions and procedures in the current sql or plsql file.

You can click on it to navigate to selected code block.

How to deploy XML publisher report to R12

XML Publisher deployment

To deploy concurrent program and request groups follow this link (FNDLOAD).

Deploy XMLP Entries

Following creates metadata for the XML publisher data definition and the associated template. This entries have to be created before uploading the actual files.


FNDLOAD apps/apps O Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct CUSTOM.ldt

Deploy RTF

java oracle.apps.xdo.oa.util.XDOLoader \
-XDO_FILE_TYPE 'RTF' -FILE_CONTENT_TYPE 'application/rtf' \
-lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct \

Deploy XLS

java oracle.apps.xdo.oa.util.XDOLoader \
-NLS_LANG American_America.AL32UTF8 \
-FILE_CONTENT_TYPE application/rtf \

Deploy Data template

java oracle.apps.xdo.oa.util.XDOLoader \
-NLS_LANG American_America.AL32UTF8 \

Friday, October 21, 2016

Bounce R12 apache server

Restart R12 apache server

Stop Server
sh $INST_TOP/admin/scripts/ stopall

Start Server
sh $INST_TOP/admin/scripts/ startall

Check Server status
sh $INST_TOP/admin/scripts/ status -l

Clear HTML cache :

# Stop the server
./ stopall
./ status  -l  
cd $COMMON_TOP/_pages
# Here are the java classes to clear.
ls -l (Check the files)
rm *

# Compile the jsp files
cd $FND_TOP/patch/115/bin --compile --flush -p 10
cd $COMMON_TOP/_pages
ls -l (Check the files)

# Start the server again
./ startall
./ status  -l

Thursday, September 29, 2016

Oracle apps R12: Useful profile option

Some useful R12 Profile Options

Output/Log Viewer

This option makes the concurrent program output to be opened in the internet explorer rather than form window.

Profile Option Name: Viewer: Text      
User: Value: browser

About this page: link

It enabled the "About this Page" link at the bottom of any OAF page. This link helps to find more information about the OA Framework page.

Profile Option Name: FND: Diagnostics 
User: Value: Yes

Forms Diagnostics

To get Diagnostics menu in forms use the following profile option

Profile Option Name: Hide Diagnostics menu entry
User Value: No

Profile Option Name: Utilities:Diagnostics
User Value: Yes

Session Timeout

This one lets the user stay logged-in longer.

Profile Option Name: ICX: Session Timeout
User Value (in Minutes): 180 

ICX: Limit time

This profile option defines the maximum connection time for a connection – regardless of user activity.
If 'ICX:Session Timeout' is set to NULL, then the session will last only as long as 'ICX: Limit Time', regardless of user activity.

Profile Option Name: ICX: Limit time
User Value (in Hours): 4

Wednesday, September 28, 2016

Jdeveloper Salesforce Adapter error

This version of the client is no longer supported

One fine day I opened the jdeveloper and added a new salesforce adapter component. I selected the wsdl and entered the username, password+security key and then "booom!!".

A nasty error message "This version of the client is no longer supported.".

What the heck is wrong with jdeveloper, you worked fine for years and why are you doing this now? grrr!!.

Would you ever give me a meaningful error message?!!


After a bit of research it is same problem we had with the server. Salesforce has disabled TLSv1.0 for all the SSL communications. (Find out more information about this here SalesForce TLS 1.0 has been disabled)

Luckily the solution is simple, just add  the following in your ../jdeveloper/jdev/bin/jdev.conf file:
AddVMOption -Dhttps.protocols=TLSv1.1 

And restart the Jdeveloper.

Note: This solution should work on both Jdev 12c and 11g

Tuesday, August 23, 2016

Automatic java mouse mover

There are many solutions to moving mouse automatically to keep the screen active in windows.

For java programmers, simple solution is to write a java program to move the mouse automatically.

package movemouse;

import java.awt.MouseInfo;
import java.awt.PointerInfo;
import java.awt.Robot;

import java.util.Random;

public class moveMouse {
    public moveMouse() {

    public static final int WAIT = 60 * 1000; // SECONDS
    public static final int OFFSET = 3;

    public static void main(String... args) throws Exception {
        int x, y;
        Robot robot = new Robot();
        Random random = new Random();
        PointerInfo a;

        while (true) {

            a = MouseInfo.getPointerInfo();
            x = (int) a.getLocation().getX();
            y = (int) a.getLocation().getY();
            robot.mouseMove(+ OFFSET, y + OFFSET);

            a = MouseInfo.getPointerInfo();
            x = (int) a.getLocation().getX();
            y = (int) a.getLocation().getY();
            robot.mouseMove(- OFFSET, y - OFFSET);

Compile and Enjoy!

If you don't have jdk use this jar file (moused.jarred). Open the link and clikc on Download button to download the file and then rename it to jar. Use the following command to execute it.

java -jar moused.jar

Thursday, August 18, 2016

Some Useful FNDLOAD commands

Following are some of the useful commands to migrate WEBADI, Concurrent programs and request set link in EBS R12.

WEB ADI or Oracle Data Integrator

FNDLOAD apps/apps 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bneintegrator.lct ldt_file_xintg.ldt BNE_INTEGRATORS INTEGRATOR_ASN="XXC" INTEGRATOR_CODE="TEST_XINTG"

FNDLOAD apps/apps 0 Y UPLOAD $BNE_TOP/patch/115/import/bneintegrator.lct ldt_file_xintg.ldt

Concurrent Programs

Concurrent program download also extracts the Executables and value sets along with it.

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct $program.ldt PROGRAM APPLICATION_SHORT_NAME=XXA CONCURRENT_PROGRAM_NAME=$program

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XXtestfile.ldt WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Request set and links

These commands will export both Request set and request set links.

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct testfile.ldt REQ_SET_LINKS REQUEST_SET_NAME='XXTEST_REQ_SET'


FND Messages

Following command will download and load fnd messages.



Tuesday, June 28, 2016

SalesForce - TLS 1.0 has been disabled - Oracle SOA BPEL webservice

One fine day all of a sudden I started getting the following errors from all the web-services trying to connect to the SalesForce system.

Client received SOAP Fault from server : UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https.

Ok, the SalesForce system was upgraded over the weekend. And one of the upgrades was to stop supporting TLS 1.0 and only support TLS 1.1 or higher version of SSL protocols.


How do we upgrade Oracle SOA web services to support TLS 1.1 or higher? 
Where does this  settings resides and how do we change it?

What a nightmare!

Luckily this is something that Java 7 supports, Phew! And it is just a matter of setting the system param


or code as

System.setProperty("https.protocols", "TLSv1.1,TLSv1.2");

in your java program before calling the webservice.

How to change it in Oracle SOA?

  • Login to SOA server (windows/Unix)
  • Goto Domain home and then cd bin
  • vi
    • and past the following content at the end of the file
  • Now bounce the SOA managed servers.
  • If you have a clustered server then remember to do it on all the nodes.
  • This solution works on Oracle SOA 12.1.3

Friday, May 06, 2016

Weblogic Tips

Some common weblogic tasks


in Windows

Append the following lines to the file $DOMAIN_HOME/bin/setDomainEnv.cmd

in Unix

Append the following lines to the file $DOMAIN_HOME/bin/

Normally files stored in the domain home could be accessed without having to set class path, this example is just for illustration.


You could set username and password in the properties files so that you dont have to enter weblogic credentials every time the server is started. It has to be done for every server

create a folder security under $domain_home/servers/AdminServer
create a new file and enter the following


The clear text password will be automatically changed to encrypted one when the weblogic starts up for the first time

Script to Start and Stop servers

Startup Script


cd /d01/fmw1213/oracle_common/common/bin



exit 0

Shutdown Script


cd /d01/fmw1213/oracle_common/common/bin



exit 0

Script to Start and Stop NodeManager

Startup Script


cd /d01/fmw1213/oracle_common/common/bin




exit 0

Shutdown Script


cd /d01/fmw1213/oracle_common/common/bin




exit 0

Managing Log files

Refer this link

Decrypt Weblogic passwords

Refer this link

How to increase heap space and permgen space?

Refer this link

Wednesday, May 04, 2016

Testing network connectivity from Salesforce

One of the challenges with consuming the web-service from SalesForce is that lack of tools, like telnet and ping, to test the network connectivity.

But luckily we code execute anonymous code in SalesForce from Developer console. Here are the steps to test web-service from sales-force.

Register URL 

All the URLs must be registered in SalesForce remote site settings before being called by the code.

  • Go to Setup > Security Controls > Remote Site Settings
  • Click on New Remote Site, enter the following and click Save
    • Remote Site Name: XX_TEST
    • Remote Site URL: http://domainhost/
  • Click Save

SalesForce Test Code

  • Go to the Developer Console 
  • Navigate Debug > Open Execute Anonymous Window  (Ctrl + E)
  • Execute the following code
  • Logs should show up in the Query Results Window

String soapEndpoint = 'https://blabla/test';
String soapBody = 'soap envelope';

HttpRequest req = new HttpRequest();
Http http = new Http();
HttpResponse resp = new HttpResponse();

//add Request header
req.setHeader('Content-type', 'text/xml; charset=utf-8');
req.setHeader('SOAPAction', 'namesspace for wsdl');

// add the endpoint to the request
try {
System.debug('Sending request');
resp = http.send(req);
}  catch(System.CalloutException e) {
System.debug('Callout error: '+ e);

Friday, April 29, 2016

SOA Composite management commands

SOA Suite Utilities

These are some of the useful wlst commands to manage SOA composites. These are better alternatives to navigating the EM console for SOA management tasks.

Before executing these commands set the JAVA_HOME and path variables for wlst commands to work. If your using unix or linux then use linux syntax for setting path variable and java_home and then run under the same oracle path.

Open cmd and enter the following

  • set JAVA_HOME=C:\UBM\Programs\jdk1.7.0_79
  • set path=C:\UBM\Programs\jdk1.7.0_79\bin;C:\Oracle\Middleware12c\Oracle_Home\oracle_common\modules\org.apache.ant_1.9.2\bin;%PATH%
  • cd C:\Oracle\Middleware12c\Oracle_Home\soa\common\bin
  • ./ or wlst.cmd

Starts SCA composite

sca_startComposite('hostname', '8001', 'weblogic', 'welcome1', 'TestSCAProcess', '1.0', partition='default')

Stops SCA composites

sca_stopComposite('hostname', '8001', 'weblogic', 'welcome1', 'TestSCAProcess', '1.0', partition='default')

Undeploy SCA composites

sca_undeployComposite("http://hostname:8001", "HelloWorld", "1.0", user="weblogic", password="welcome1",partition='myPartition')

Lists all SOA composites

sca_listDeployedComposites('hostname', '8001', 'weblogic', 'welcome1')

Assign Default composite

Sets a SOA composite application revision as the default version. This revision is instantiated when a new request comes in.
sca_assignDefaultComposite("hostname", "port", "weblogic", "welcome1","HelloWorld", "1.0", partition='myPartition')

Delete MDS files

# This command will delete all the files under /apps directory in mds.
connect('weblogic', 'welcome1', 't3://localhost:7101');

Wednesday, April 20, 2016

How to increase JVM memory in Weblogic

There are two OutOfMemoryError that the weblogic server might throw if the memory settings are not tuned.

  •  java.lang.OutOfMemoryError: Java heap space
    • The heap space error could be fixed by tunning Xms (minimum heap space) and Xmx (maximum heap space) parameters
  •  java.lang.OutOfMemoryError: PermGen space
    • And perm gen error could be fixed by tunning the PermSize parameter.

How to change memory settings in weblogic

There are many ways to change it and no of the standard ways is to change the file and append the following lines at the end of the file.

Remember to restart the server for this setting to take effect.

echo "******Custom Memory Settings for UBM SOA servers******"
echo "Server Name ${SERVER_NAME}"
echo "Memory Arguments  ${MEM_ARGS}"

if [ "${SERVER_NAME}" = "WLS_SERVER1" ] ; then
        MEM_ARGS=" -Xms1024m -Xmx3584m -XX:PermSize=512m -XX:MaxPermSize=1536m "
        export MEM_ARGS

if [ "${SERVER_NAME}" = "AdminServer" ] ; then
        MEM_ARGS=" -Xms1024m -Xmx2584m -XX:PermSize=512m -XX:MaxPermSize=1536m "
        export MEM_ARGS

How to verify

Run the ps -ef command in unix/Linux to check if the paratemers are passed correctly to the jvm

ps -ef | grep java | cut -c 1-200

And you can also see the actual memory usage at the OS level using top command.

Monday, April 18, 2016

Weblogic Datasource Setup

How to create datasource for ADF application 11g/12c

  • Goto Weblogic Console
  • Select Data Sources on the Home Page
  • Click New → Generic Data Source
    • Enter the following and click Next
    • Name: AppDataSource
    • JNDI Name: jdbc/AppDS
    • Database Type: Oracle
  • Choose the JDBC driver type and click Next:
    • Database Driver: *Oracle’s Driver (Thin) for Instance Connections; Versions: Any
  • Leave the default Transcation Options and click Next :
  • Enter the database connection properties and click Next :
    • Database Name: TBD
    • Hostname: TBD
    • Port: TBD
    • Database User: apps
    • Password: TBD
    • oracle.jdbc.DRCPConnectionClass: --Blank-
  • Test the configuration and Click Next:
  • Select the Target Server: It must be targeted to the cluster or servers where the ADF app is deployed (Exclude AdminServer from the target).
  • And finish.

How to create XADatasource for SOA Suite 11g/12c


  • Goto Weblogic Console
  • Select Data Sources on the Home Page
  • Click New → Generic Data Source
    • Enter the following and click Next
    • Name: AppDataSource
    • JNDI Name: jdbc/AppDS
    • Database Type: Oracle
  • Choose the JDBC driver type and click Next:
    • Database Driver: *Oracle’s Driver (Thin XA) for Instance Connections; Versions: Any
  • Leave the default Transcation Options and click Next :
  • Enter the database connection properties and click Next :
    • Database Name: TBD
    • Hostname: TBD
    • Port: TBD
    • Database User: apps
    • Password: TBD
    • oracle.jdbc.DRCPConnectionClass: --Blank-
  • Test the configuration and Click Next:
  • Select the Target Server: It must be targeted to the SOA cluster or SOA managed servers (Exclude AdminServer from the target).
  • And finish.
  • Remember to create JNDI name to access this datasource from DB adapter or AQ adapter .
    • This steps is only for SOA suite.

DB Adapter (Only for SOA)

  • Select Deployments on the Home Page
  • Click DbAdapter from the list
  • Select tabs Configuration > Outbound Connection Pools
  • Click on New button and select javax.resource.cci.ConnectionFactory
  • Enter JNDI Name : eis/DB/apps
    • This JNDI name should be same as the one entered in *.jca file.
  • Click on Finish 
  • Now expand the javax.resource.cci.ConnectionFactory and click on the JNDI name you just created.
  • Enter the data-source name.
    • For XA Datasources enter XADatasourceName
    • For non-xa datasources just enter DatasourceName
    • Remember to hit Enter on the keyboard as this form only registers data on keyboard enter.
  • Click on Save button
  • Go back to the Deployments page.
  • Select the DbAdapter and click on Update
  • Select Update option and click on finish
    • If its the first time, the user will be asked to create a directory path for plan file. Choose the location when asked.

AQ Adapter (Only for SOA)

  • Steps to create JNDI name for AQ adapter is same as DB adapter. It just needs repeating the above steps for AqAdapter in the deployments.

Saturday, February 20, 2016

Unix Tips

Unix Tips

# These commands gets executed when the use logs in the shell
# File path: $home/.bashrc

# Setting Path
export PATH=/u01/app/oracle/products/jdk1.8.0_66/bin:$PATH

# Setting variables
export DHOME

export LOGS

# Settings aliases
alias domain='cd /u01/app/oracle/products/jdk1.8.0_66/bin'

Other useful commands

# List out running processes
ps -ef | grep java

# Push a foreground process into background
^z ; # suspends the foreground process
bg ; # pushes suspended process into background process

# zip and unzip folders
zip -r soasit_domain

# Find a text in files
find . "*.xml" | xargs grep -il "searchText"

# Matching any line which start with echo egrep '^(( )+|( )?)echo' filename

# Monitoring Log files
tail -100f filename

# Set putty title
echo -e "\033]0; `hostname` \007\c"

# Color ls
alias l='ls --color=auto -lrt'

# Change the date stamp on the file
touch -r referenceFile filename

# Cpu usage

#Query Memory info
Total Memory: grep MemTotal /proc/meminfo
Swap Space: grep SwapTotal /proc/meminfo
Shared Memory: df -k /dev/shm/
Free Memory: free

#Find system details
Processor info: grep "model name" /proc/cpuinfo
System Architecture: uname -m
Disk Space: df -h
Linux version: cat /proc/version
Kernel Version: uname -r
Hostname: hostname

Users and Groups

# Add user and groups
/usr/sbin/useradd -g oinstall -G dba oracle
/usr/sbin/groupadd oinstall

#To change the Password: 

#Display user details: 
id oracle

# Assign user group and groups

/usr/sbin/usermod -g oinstall -G dba oracle

# Change Path for all users


tar cvzf foo.tgz *.cc *.h This creates (c) a compressed (z) tar file named foo.tgz (f) and shows the files (v). tar cvzf foo.tgz cps100 >> will tar the directory cps100 tar tzf foo.tgz >>To see a tar file's table of contents tar xvzf foo.tgz >> To extract the contents of a tar file This untars/extracts (x) into the directory, prints the files (v). tar xvzf foo.tgz You can extract only one (or several) files

Vi Scripts

To repalace the last occuring character "/" with Tab :%s,/\([^/]*$\),\t\1, Eg: /home/prasanna/temp/hill.txt results in /home/prasanna/temp hill.txt

Finding files in Linux based on time

find . -name "hello" -printf "%a %c %t %f \n" find . -follow \( -mtime 2 -o -mtime +2 \) -print %a - access time (reading, coping) %c - Changed time of file parameters or properties %t - modify time of file content %f - filename without dirs -atime n - accessed n days ago -mtime n - modified n days ago -ctime n - changed n days ago

# Find and delete files older than a day

find . -mtime +1 -exec rm {} \;


#Telnet to test host port 
telnet hostname port

#Alternative to telnet
nc -zv hostname port

#Could be used to test connectivity as well
openssl s_client -connect

#Local port forwarding
ssh -L 2521:destinationhost:1521 remotehost

#Remote port forwarding
ssh -R 2521:destinationhost:1521 remotehost

#Forwarding GUI programs
ssh -X remotehost

To learn more about port forwarding check

FTPs (FTP over ssl)

Commands to transfer files to FTPs server (also called as FTP over ssl). 

#upload file
curl -v --user username:password --ftp-ssl  -k ftp://Ftp_Hostname:21/home/folder1/ -T TestFile

#List files
curl --user username:password --ftp-ssl -l  -k ftp://Ftp_Hostname:21/home/folder1/*

#Download file
curl --user username:password --ftp-ssl  -k ftp://Ftp_Hostname:21/home/folder1/TestFile -o TestFile

#Delete file
curl -v --user username:password --ftp-ssl  -k ftp://Ftp_Hostname:21/home/folder1/ -Q "DELE /home/folder1/TestFile"

Tuesday, February 16, 2016

Useful xslt code

How to convert XML list into comma seperated list

 <xsl:for-each select="/ns0:UserId">
            <xsl:value-of select="."/>
            <xsl:if test="position() != last()">




How to strip of empty elements from xml

This xslt code work with any XML types, so it could be saved in a common location and used everywhere.

<xsl:stylesheet version="2.0" xmlns:xsl="" xmlns:xs="" xmlns:fn="" exclude-result-prefixes="fn xs">
        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
        <xsl:template match="node()|@*">
                <xsl:if test="normalize-space(string(.)) != ''">
                                <xsl:apply-templates select="node()|@*"/>

How to find distinct values and group in XSLT

This xslt will groups the xml elements by distinct UserID

 <xsl:key name="UserId" match="/ns0:queryResponse/ns0:QueryResults/ns0:records/ns0:UserId/text()"
  <xsl:template match="/">
      <xsl:for-each select="/ns0:queryResponse/ns0:QueryResults/ns0:records/ns0:UserId/text()[generate-id() = generate-id(key('UserId',.)[1])]">
            <xsl:value-of select="."/>
          <xsl:call-template name="getResponsibility">
            <xsl:with-param name="UserId" select="."/>
            <xsl:with-param name="records" select="/ns0:queryResponse/ns0:QueryResults/ns0:records"/>
  <xsl:template name="getResponsibility">
    <xsl:param name="UserId"/>
    <xsl:param name="records"/>
    <xsl:for-each select="$records[ns0:UserId/text() = $UserId]">
          <xsl:value-of select="ns0:rId"/>
          <xsl:value-of select="ns0:rName"/>





List out all the XML elements

I needed this for XSD documentation work. Generate a sample XML from the xsd and use that as  input to this xslt. It prints out all the elements in xpath format relative to root element.

<xsl:stylesheet version="1.0" xmlns:xsl="">

    <xsl:output method="text" indent="no" />

    <xsl:template match="*[not(*)]">
        <xsl:for-each select="ancestor-or-self::*">
            <xsl:value-of select="concat('.', substring-after(name(),':'))"/>

            <xsl:if test="count(preceding-sibling::*[name() = name(current())]) != 0">
                <xsl:value-of select="concat('[', count(preceding-sibling::*[name() = name(current())]) + 1, ']')"/>
        <xsl:apply-templates select="*"/>

    <xsl:template match="*">
        <xsl:apply-templates select="*"/>