Showing posts with label File/FTP Adapter. Show all posts
Showing posts with label File/FTP Adapter. Show all posts

Monday, 9 January 2017

Generating .csv file using FileAdapter in Oracle SOA 11g

First create a csv file in excel and save it in csv format.

 


Create a SOA application -> SampleCSVApp and a SOA project inside it CSVTest
Drop a FileAdapter from Component Palette and give a name like WriteCSV select the write operation Type.
Next step select the output Directory and give a file name.



In next step  select the native format builder by clicking the icon next to search icon

















Select delimited option


Now here in this step you will browse the .csv file that we have created earlier 















Select the datatypes of the column and give element name















































Check use the first record as the field names and select next now you will see a xsd is generated with specified type and name.




















You can test it by clicking on Test and finish.













Now create a one way bpel process and in input parameter select the same sample xsd element.





























Now use a transform activity to send input data to file.


The generated file will not have header names details in it.if you want to add the header name details in generated csv file .for the the generated xsd file  need to be modified and these attributes need to be added into the xsd as shown below

            nxsd:hasHeader="true"
            nxsd:headerLines="1"
            nxsd:outboundHeader="Name,EmpID,DeptID ${eol}"
            nxsd:headerLinesTerminatedBy="${eol}"















Deploy it and test it...!

Saturday, 10 December 2016

FTP Adapter Configuration for SFTP Communication in SOA using public key authentication process

Target : To establish SFTP communication between the SOA server and the SFTP server and configure FTP Adapter using public key authentication process.


Solution :

1. Login to the SOA server
cd ~ ( This will navigate to the home location of the user )
cd .ssh

2. Execute the below command. This will generate the public and private key
ssh-keygen

3. After entering the above command, you would be asked the file where the keys would be saved.
 Accept the default values and enter. Now, the identification will be saved at the below location
Private key location : /<home location of the user>/.ssh/id_rsa
Public Key Location : /<home location of the user>/.ssh/id_rsa.pub

4. Copy the public key of the SOA host ( /<home location of the user>/.ssh/id_rsa.pub ) to the 
known_hosts/authorized keys of the SFTP server. This can be done by copying the content of 
the pub key file into the authorized_keys file. 
( If not sure how to perform this, please contact the system admin )

5. On the SFTP server, make sure you have the required privileges on the authoroized_keys

6. Now test the SFTP communication. This can be done by the following steps on the SOA server
sftp <sftp_user>@SFTPHOST

Alternatively, You can use the below command if the SFTP is running on a different port apart from the 
default one :
sftp -vvv -oPort=<port number> <user>@<SFTP HOST>

7. When you do this for the first time, you will be prompted for confirmation. Type "yes"

8. This completes the SFTP communication between the SOA server and the SFTP host.

9. Once the communication is established, now configure the adapter :
Update the FTP adapter connection pool which you are using with the below parameters :
o Authentication type : publickey
o Host : <SFTP Host Name>
o Port : <SFTP Port>
o Private key file : /<user's home>/.ssh/ id_rsa
The above is the private key path which has been created in the 1s step.
o Username : <SFTP User>
o useSFTP : true

10. Save and activate the changes. Update the deployment FTP Adapter.

Wednesday, 7 December 2016

connection break up while connecting to remote FTP server.

ORABPEL-11445
The SSH API threw an exception.
If you get such type of error while connecting to remove FTP server then do the following..
1. Set the following two partnerlink properties in the BPEL project bpel.xml file:
<property name="useJCAConnectionPool">true</property>
<property name="cacheConnections">false</property>
After these changes redeploy the BPEL project.
2. On the BPEL server set $ORACLE_HOME/j2ee/<bpel>/application-deployments/default/FtpAdapter/oc4j-ra.xml
keepConnections config-property for the FTP adapter connector-factory being used to this:
<config-property name="keepConnections" value="false">
Restart the system and test it.
Adding connection pool=private for performance tuning.
<connection-pooling use="private">
<property name="waitTimeout" value="300" />
<property name="scheme" value="fixed_wait" />
<property name="maxConnections" value="50" />
<property name="inactivity-timeout-check" value="all" />
<property name="minConnections" value="5" />
<property name="inactivity-timeout" value="50" />
</connection-pooling>

Tuesday, 6 December 2016

Save A Processed File On An Archive Directory

Archiving a file when using FTP Adapter is very important. From some reason a file might be poled but not processed.
To overcome it, there is an option to save a backup file, after the file was polled.
When using FtpAdapter, you can choose to save a backup file on the remote FTP server, or on the local server.
In this post I will explain how to do it.
First option – Save the file on the FTP server
Follow the next steps:
  1. Create an archive directory on the remote FTP server.
  2. A property on the FtpAdapter called UseRemoteErrorArchive is by default set to true.
    If from any reason it’s set to false, just change it (on the .jca file as being described in the next point)
  3. Add the property PhysicalErrorArchiveDirectory and put the full path of the archive file directory you created on point 1.
    There are 2 ways to do it:
    First way: On the EM right click your process name (under soa-infra/”partition name”) -> Choose “Service/Refernece Properties” -> Choose your Service name(The name of the
    FtpAdapter) -> Go to Properties tab-> Click Add -> Choose PhysicalErrorArchiveDirectoryand put in the value the directory path -> Save.
    Second way: Go to your project on the JDeveloper -> Enter the file “FtpAdapter name”.jca -> Add the property as follows:
     <property name=”PhysicalErrorArchiveDirectory” value=”/archive”/>Redeploy the project 
Second option – Save the file on the local server
Follow the next steps:
  1. Create an archive directory on the local server
  2. Add the two following properties –  UseRemoteErrorArchive, PhysicalErrorArchiveDirectory and set them as follows:
    <property name=”UseRemoteErrorArchive” value=”false”/>
    (Can be set only from .jca file as described in First option point 3)
    <property name=” PhysicalErrorArchiveDirectory ” value=”/archive”/>
    (Can be set in both ways as described in First option point 3)
  3. Save and Redeploy your project

Solve error 530 user

Below is a description of the problem & solution on the weblogic side, assuming there’s no problem with FTP server (connection to FTP server is possible from other machines…)
530 user error can happen because there is a problem with validating one of the parameters: host/user name/password
Possible Solutions:
Change one of the parameters in the FtpAdapter property under Deployments on the Weblogic console:
(For each attribute’s change, need to press the Enter key)
  1. Host: replace IP with host name
  2. User name/ password: write it manually (no copy paste)
  3. Update the FtpAdapter: WL home->Deployments->check the FtpAdapter checkbox->click on the ‘Update’ button
If connection error is still raised you might need to delete and create a new connection.

‘Put’ operation failed due to a stale connection

You are getting the following error when trying to execute FTP connection using FtpAdapter on 11g:
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: “JCA Binding execute of Reference operation ‘Put’ failed due to…….A stale Connection Factory or Connection Handle may be used”
The cause of the problem:
You performed a redeployment  to the FtpAdapter in the WebLogic server.
During the redeployment there are already existing connection in the connection pool, that are being managed by the JCA ConnectionManager.
The WebLogic server doesn’t inform the connection pool about the new change (can be seen in weblogic-ra.xml). So now, Because there are already existing connections within the pool, they become stale

To solve this error:
Perform Update and not Redeploy to the FtpAdapter (Updates the weblogic-ra.xml):
  1. Go to Weblogic console
  2. Click on Deployments
  3. Click on FtpAdapter
  4. Modify and Save your new setting
  5. Click on Deployments
  6. Mark the FtpAdapter checkbox
  7. Click the Update button
  8. Choose “Update this application in place with new deployment plan changes. (A deployment plan must be specified for this option)”
  9. Click Finish

FTP Operations Are Not Working

I’ve noticed something very interesting in the log file when the ‘GET’ operation stopped working (Poll files from remote server).
I found some errors like:

BINDING.JCA-11007
No Data to process
BINDING.JCA-11430
Error in listing files in the remote directory.
Unable to list file in remote directory.
Please make sure that the ftp server settings are correct
Caused by: BINDING.JCA-11426
Unable to enter passive mode
File Adapter testTab PollWork::run exiting, Worker thread will die
Digging into it made me understand that the log will not always direct me to the solution and solve my problem.
I thought about posting here some of the reasons that might cause the ‘GET’ operation for stop working (might help also for ‘PUT’ operation).
I really hope  some of the solutions or explanation can help you. I will try add more details in the future if I will encounter other problems.
I’ve divided it into local & remote issues:
On the remote server:
  1. The permissions on the remote server changed and you can’t poll files
  2. There are too many files in the polling directory.
    FTP adapter work in that way, that it first lists all the existing files, and in the end it polls the relevant file.
    (In that way an incoming new file will not be taken during the polling operation)
    If you have a timeout limitation, the FTP adapter will not have sufficient time to poll the required file.
  3. The polling directory is not correct.
    There might be a mapping between the home directory on the remote server to your local network.
On the local server:
  1. Verify you don’t have a process with old version that is still active
  2. On the JNDI connection (WL console) enter manually the remote server details (host/user/password).
  3. Verify you redeploy the FtpAdapter correctly. For most cases you need to update the deployment, as I explained in my post: ‘Put’ operation failed due to a stale connection.
  4. After updating the FtpAdapter/JNDI connection, enter it again and verify the updated data exist.

FTP Adapter control directory permission issue

Finally I am going to start writing my first blog. I have been thinking about this for a quite a long time, but as you know all developers are very lazy about documentation, I am not an exception!

Our company have recently upgraded to SOA 11g and as any normal infrstructure setup, multiple SOA installations and domains are running on the same UNIX box with different UNIX users.

Issue:

We have a FTP Adapter which polls for FTP directory every 10 minutes. On the new SOA env. the FTP Adapter composite was not working. The error in the SOA out log as below:

<Dec 27, 2012 12:05:55 PM CST> <Error> <oracle.soa.adapter> <BEA-000000> <JCABinding=>  [FileTransfer_BPEL.FTP_Read/1.0] :update Unable to notify adapter of property changes>
<Dec 27, 2012 12:06:13 PM CST> <Warning> <oracle.soa.adapter> <BEA-000000> <FTP Adapter FileTransfer_BPEL PollWork::run exiting, Worker thread will die>


Trial and errors:

Found out the metalink note
FTP Adapter Unable To Notify Adapter Of Property Changes [ID 1361488.1]

But no use as for all the env. that we setup, we have copied the same FTPAdapterPlan.xml. Also verified that we have correct WIN setup for windows FTP server.

Tried redeploying the composite, redeploying the FTP Adapter rar and bouncing server but no use. Did not see the actual error, just the same error. The file was not getting picket up.


Resolution:

Finally the actual error after enabling the TRACE:32 level for "oracle.soa.adapter" logger configuration.

Ref: How to enable TRACE / DEBUG logging in Oracle SOA Suite 11g (inc. VIDEO) [ID 1325672.1]

The actual error was

[2012-12-27T19:26:59.937-06:00] [WLS_SOA1] [TRACE] [] [oracle.soa.adapter] [tid: Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms\n] [userId: weblogic] [ecid: 2d000586bc52cf4f:-5c6890da:13bb56447d7:-8000-0000000000103750,1:32504] [SRC_CLASS: oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl] [APP: soa-infra] [SRC_METHOD: log] FTP Adapter FileTransfer_BPEL Calling getContentsAsStream() on FTPAgent:     10.***.**.**: type = FTP, host = 10.***.**.**:**[[
        directory = null, mode = STREAM, fileType = ASCII, maxRetries = 0 Localfile: test abc.csv Path: /tmp/controlDir/fileftp/temp_ftp/FileTransfer_BPEL/vdwPC9gmvckcGo5UIOLFSE9TNYQiGy5pzrkKskohmLY=/inbound/dO0jjx_Ncm5QvT8gY7cgq2YVG1a2LtJ312mrtFI_BkE= Remote Dir: FTP_DIR
]]
2012-12-27T19:26:59.937-06:00] [WLS_SOA1] [TRACE] [] [oracle.soa.adapter] [tid: Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms\n] [userId: weblogic] [ecid: 2d000586bc52cf4f:-5c6890da:13bb56447d7:-8000-0000000000103750,1:32504] [SRC_CLASS: oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl] [APP: soa-infra] [SRC_METHOD: log] FTP Adapter FileTransfer_BPEL [[
BINDING.JCA-11440
Error in writing temp file after getting content.
Error in writing temp file after getting content.
Error in writing temp file after getting content for file: test abc.csv
Please ensure 1. the local filesystem has write permission 2. local file system is not full.

        at oracle.tip.adapter.ftp.inbound.FTPSource.getContents(FTPSource.java:991)
        at oracle.tip.adapter.ftp.inbound.FTPSource.getFileFromSource(FTPSource.java:912)
        at oracle.tip.adapter.file.inbound.ProcessorDelegate.getContentAsFile(ProcessorDelegate.java:439)
        at oracle.tip.adapter.file.inbound.ProcessorDelegate.process(ProcessorDelegate.java:137)
        at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:349)
        at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
        at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
        at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
]]

Since we have multiple SOA env running on the same UNIX box with different UNIX users, below directory did NOT have write permission at group level. 
/tmp/controlDir/fileftp/temp_ftp/FileTransfer_BPEL


Once the write permission is given for group level, the FTP Adapter started working.

Next steps:

To find out whether we can control the temp directory location.

Hope this helps!

Saturday, 3 December 2016

Python Script - FTP Adapter Connection Pool JNDI Creation

FTP Adapter Connection Pool JNDI Creation



My Server Details are,

Cluster Environment: 1 Admin Server and 2 Managed Server (wls_osb1 and wls_osb2) 

Domain Name: soa_domain

Save below weblogic.properties


#################################################################################

# admin server url
admin.url=t3://localhost:7001

#################################################################################

#Domain Name:
domainName=soa_domain
osbServer1=wls_osb1
osbServer2=wls_osb2

#Manage Server Name:
targetServer.1=wls_osb1
targetServer.2=wls_osb2

#Cluster Name:
osb_ClusterName=osb_cluster
migrateServerType=MigratableTarget
clusterServerType=Cluster
normalServerType=Server

#################################################################################
#   FTP adapter Properties
#################################################################################

#Below FTP Adapter JNDI will be create

#DB Adapter JNDI for OFM: 1. eis/ftp/OMCSSFTP
#   2. eis/ftp/EGDC
#   3. eis/ftp/ISCM

#################################################################################
#  Plan and Adapter Path
shared_FTP_PlanPath=/u01/Middleware/Oracle_OSB1/soa/connectors/FTP_plan.xml
FTP_appPath =/u01/Middleware/Oracle_OSB1/soa/connectors/FtpAdapter.rar

#################################################################################
# FTP adapter JNDI entry
#Total how many AQ JNDI needs to be create
total.FTPjndi=3

FTP_eisName.1=eis/ftp/OFMSFTP
FTP_host.1=localhost
FTP_password.1=changeit
FTP_port.1=22
FTP_username.1=j_acda
FTP_useSftp.1=true
FTP_controlDir.1=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.1=jdbc/SOADataSource
FTP_outboundDataSource.1=jdbc/SOADataSource
FTP_outboundDataSourceLocal.1=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.1=oracle
FTP_authenticationType.1=PUBLICKEY
FTP_changeDirectory.1=false
FTP_enforceFileTypeFromSpec.1=false
FTP_ftpAbsolutePathBegin.1=/
FTP_ftpPathSeparator.1=/
FTP_ignorePermissionsOnFile.1=true
FTP_preferredCipherSuite.1=blowfish-cbc
FTP_privateKeyFile.1=/u01/local/rsa/id_rsa
FTP_workingDirectory.1=default

FTP_eisName.2=eis/ftp/OMS
FTP_host.2=185.29.224.14
FTP_password.2=C0ndu1t01
FTP_port.2=22
FTP_username.2=OFM
FTP_useSftp.2=true
FTP_controlDir.2=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.2=jdbc/SOADataSource
FTP_outboundDataSource.2=jdbc/SOADataSource
FTP_outboundDataSourceLocal.2=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.2=oracle
FTP_authenticationType.2=password
FTP_changeDirectory.2=false
FTP_enforceFileTypeFromSpec.2=false
FTP_ftpAbsolutePathBegin.2=/
FTP_ftpPathSeparator.2=/
FTP_ignorePermissionsOnFile.2=false
FTP_preferredCipherSuite.2=aes128-cbc
FTP_privateKeyFile.2=
FTP_workingDirectory.2=default

FTP_eisName.3=eis/ftp/Oracle
FTP_host.3=194.72.50.34
FTP_password.3=chaos15
FTP_port.3=21
FTP_username.3=FUSIONE2E
FTP_useSftp.3=false
FTP_controlDir.3=/u01/Middleware/user_projects/domains/osb_domain/ftpadapter
FTP_inboundDataSource.3=jdbc/SOADataSource
FTP_outboundDataSource.3=jdbc/SOADataSource
FTP_outboundDataSourceLocal.3=jdbc/SOALocalTxDataSource
FTP_outboundLockTypeForWrite.3=oracle
FTP_authenticationType.3=password
FTP_changeDirectory.3=true
FTP_enforceFileTypeFromSpec.3=true
FTP_ftpAbsolutePathBegin.3=
FTP_ftpPathSeparator.3=
FTP_ignorePermissionsOnFile.3=true
FTP_preferredCipherSuite.3=aes128-cbc
FTP_privateKeyFile.3=
FTP_workingDirectory.3=

#################################################################################

Now, you have to save python script as Create_FTPAdapters.py

#################################################################################

#!/usr/bin/python
from java.io import FileInputStream
import time

propInputStream= FileInputStream('weblogic.properties')
configProps = Properties()
configProps.load(propInputStream)

adminURL= configProps.get('admin.url')
# Enter username and password
adminUserName= ''
adminPassword= ''
total_jndi_to_create=configProps.get('total.FTPjndi')

appName='FtpAdapter'
moduleOverrideName=appName+'.rar'
moduleDescriptorName='META-INF/weblogic-ra.xml'

planPath = configProps.get('shared_FTP_PlanPath')
appPath = configProps.get('FTP_appPath')


def makeDeploymentPlanVariable(wlstPlan, name, value, xpath, origin='planbased'):
  """Create a varaible in the Plan.
  This method is used to create the variables that are needed in the Plan in order
  to add an entry for the outbound connection pool for the new data source.
  """
  try:

    variableAssignment = wlstPlan.createVariableAssignment(name, moduleOverrideName, moduleDescriptorName)
    variableAssignment.setXpath(xpath)
    variableAssignment.setOrigin(origin)
    wlstPlan.createVariable(name, value)
  except:
    print('--> was not able to create deployment plan variables successfully')
def main():
  #
  # generate a unique string to use in the names
  #
  uniqueString =''
  uniqueString = str(int(time.time()))
  #
  # Create a JDBC Data Source.
  #
  try:
    print('--> about to connect to weblogic')
    connect(adminUserName, adminPassword, adminURL)
    edit()

#
# update the deployment plan
#
    startEdit()
    i=1
    while (i <= int(total_jndi_to_create)):
cd('/')
print('--> about to update the deployment plan for the FtpAdapter')
eisName = configProps.get('FTP_eisName.'+ str(i))
print('--> about to create a Adapter JNDI ' + eisName)
Host = configProps.get("FTP_host."+ str(i))
print('--> about to assign a FTP host ' + Host)
userName = configProps.get("FTP_username."+ str(i))
print('--> about to assign a FTP userName ' + userName)
Port = configProps.get("FTP_port."+ str(i))
print('--> about to assign FTP port ' + Port)
Password = configProps.get("FTP_password."+ str(i))
print('--> about to assign FTP Password ' + Password)
UseSftp = configProps.get("FTP_useSftp."+ str(i))
print('--> about to assign FTP UseSftp ' + UseSftp)
ControlDir = configProps.get("FTP_controlDir."+ str(i))
print('--> about to assign FTP controlDir ' + ControlDir)
InboundDataSource = configProps.get("FTP_inboundDataSource."+ str(i))
print('--> about to assign FTP inboundDataSource ' + InboundDataSource)
OutboundDataSource = configProps.get("FTP_outboundDataSource."+ str(i))
print('--> about to assign FTP outboundDataSource ' + OutboundDataSource)
OutboundDataSourceLocal = configProps.get("FTP_outboundDataSourceLocal."+ str(i))
print('--> about to assign FTP outboundDataSourceLocal ' + OutboundDataSourceLocal)
OutboundLockTypeForWrite = configProps.get("FTP_outboundLockTypeForWrite."+ str(i))
print('--> about to assign FTP outboundLockTypeForWrite ' + OutboundLockTypeForWrite)
AuthenticationType = configProps.get("FTP_authenticationType."+ str(i))
print('--> about to assign FTP authenticationType ' + AuthenticationType)
ChangeDirectory = configProps.get("FTP_changeDirectory."+ str(i))
print('--> about to assign FTP changeDirectory ' + ChangeDirectory)
EnforceFileTypeFromSpec = configProps.get("FTP_enforceFileTypeFromSpec."+ str(i))
print('--> about to assign FTP enforceFileTypeFromSpec ' + EnforceFileTypeFromSpec)
FtpAbsolutePathBegin = configProps.get("FTP_ftpAbsolutePathBegin."+ str(i))
print('--> about to assign FTP ftpAbsolutePathBegin ' + FtpAbsolutePathBegin)
FtpPathSeparator = configProps.get("FTP_ftpPathSeparator."+ str(i))
print('--> about to assign FTP ftpPathSeparator ' + FtpPathSeparator)
IgnorePermissionsOnFile = configProps.get("FTP_ignorePermissionsOnFile."+ str(i))
print('--> about to assign FTP ignorePermissionsOnFile ' + IgnorePermissionsOnFile)
PreferredCipherSuite = configProps.get("FTP_preferredCipherSuite."+ str(i))
print('--> about to assign FTP preferredCipherSuite ' + PreferredCipherSuite)
PrivateKeyFile = configProps.get("FTP_privateKeyFile."+ str(i))
print('--> about to assign FTP privateKeyFile ' + PrivateKeyFile)
WorkingDirectory = configProps.get("FTP_workingDirectory."+ str(i))
print('--> about to assign FTP workingDirectory ' + WorkingDirectory)
startEdit()
print('--> Using plan ' + planPath)
plan = loadApplication(appPath, planPath)
print('--> adding variables to plan')
print '___ BEGIN change plan'
makeDeploymentPlanVariable(plan, 'ConnectionInstance_'+ eisName +'_JNDIName_'+ uniqueString, eisName,  '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/jndi-name')
makeDeploymentPlanVariable(plan, 'ConfigProperty_host_'+ Host + '_',Host, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="host"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_password_'+ Password + '_',Password, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="password"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_port_'+ Port + '_',Port, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="port"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_username_'+ userName + '_',userName, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="username"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_useSftp_'+ UseSftp + '_',UseSftp, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="useSftp"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_controlDir_'+ ControlDir + '_',ControlDir, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="controlDir"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_inboundDataSource_'+ InboundDataSource + '_',InboundDataSource, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="inboundDataSource"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundDataSource_'+ OutboundDataSource + '_',OutboundDataSource, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundDataSource"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundDataSourceLocal_'+ OutboundDataSourceLocal + '_',OutboundDataSourceLocal, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundDataSourceLocal"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_outboundLockTypeForWrite_'+ OutboundLockTypeForWrite + '_',OutboundLockTypeForWrite, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="outboundLockTypeForWrite"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_changeDirectory_'+ ChangeDirectory + '_',ChangeDirectory, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="changeDirectory"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_enforceFileTypeFromSpec_'+ EnforceFileTypeFromSpec + '_',EnforceFileTypeFromSpec, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="enforceFileTypeFromSpec"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ftpAbsolutePathBegin_'+ FtpAbsolutePathBegin + '_',FtpAbsolutePathBegin, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ftpAbsolutePathBegin"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ftpPathSeparator_'+ FtpPathSeparator + '_',FtpPathSeparator, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ftpPathSeparator"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_ignorePermissionsOnFile_'+ IgnorePermissionsOnFile + '_',IgnorePermissionsOnFile, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="ignorePermissionsOnFile"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_preferredCipherSuite_'+ PreferredCipherSuite + '_',PreferredCipherSuite, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="preferredCipherSuite"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_privateKeyFile_'+ PrivateKeyFile + '_',PrivateKeyFile, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="privateKeyFile"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_workingDirectory_'+ WorkingDirectory + '_',WorkingDirectory, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="workingDirectory"]/value')
makeDeploymentPlanVariable(plan, 'ConfigProperty_authenticationType_'+ AuthenticationType + '_',AuthenticationType, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="authenticationType"]/value')
print '___ DONE change plan'
print('--> saving plan')
plan.save();
save();
print('--> activating changes')
activate(block='true');
cd('/AppDeployments/FtpAdapter/Targets');
print('--> redeploying the FtpAdapter')
 
redeploy(appName, planPath, targets=cmo.getTargets());
print('--> done')
i=i+1
  except:
     print('--> something went wrong, bailing out')
     stopEdit('y')
     raise SystemExit

main()

#################################################################################

Procedure to run above python script,

Step1: Copy your weblogic.properties and Create_FTPAdapters.py        
           in /u01/Middleware/wlserver_10.3/common/bin loaction. Where wlst.sh or wlst.cmd present
Step2: Run ./wlst.sh (if you install middleware in UNIX) or wlst.cmd (if you install middleware in 
            windows)
Step 3: When Username and Password asked that time you have to pass weblogic console username and password.