Monday, June 06, 2011

FTP Adapter in SOA Suite 11g

In this exercise i will create a simple process (inbound operation) to poll a file from a remote FTP server.This is how my process looks like.



There are few things which we need to take care of.

1>The FTP server JNDI name

In the adapter configuration wizard you will get this detail

as you can see in my case it is eis/ftp/FtpAdapter

This is the default jndi created and i need to create the same in my admin server.

we will check it later first we will what all we need to see in configuration wizard



Now since i am polling data i will be using a get data to get the data from the FTP location



Provide the location of the remote FTP server which you are polling.




I am making a wild card entry





finally i am using an opaque schema to validate the file.





Now coming back to the configuration required from admin console.

Log in to admin console

http://host:port/console.

Go to Deployment and choose FTP adapter as shown




Now go to configuration and then outbound configuration pools and create a new connection pool by clicking on new.

I already have created a connection pool with the same name as has come in jdeveloper as you can see "eis/ftp/FtpAdapter"





Now open the connection that you have create and check for the attributes

you need to specify four attributes there

first is host name

It is the name of the remote host from where you are polling data as can be seen



You need to specify the password to connect to the server and the port in which FTP server will be connected,by default it is 21(in my case it is 21)



Now in the last page of the attribute you have to specify the name of the username,this is the username for the remote machine.


These are the configuration that you need to do in order to make your FTP adapter in soa suite 11g work.One important thing is that do update your FTP adapter configuration once you are done with all the settings.

Now copy a text file in the location which is to be polled and you will find it will be polled as per the polling frequency and you will see an instance generated in the em console.


I will demonstarte this by using the most common FTP server fileZilla.

I have my soa server in remote machine,and i will install a fileZilla FTP server in my local machine.One you download the server,just extract and install it at your end.If you wish you can create a group also but a user only will work.
Create user and map a local drive in your machine as you can see.There is one important thing to consider here that this directory will be considered as a root directory for the remote server.



Now as you can see the directory structure i have mapped D:\RemoteFTP as my root directory.Now i will create a new folder within this called test.So now my configuration will look something like this in jdeveloper for the location




As you can see ideally i should have provide the path as D:\RemoteFTP\test but i have specified it as \test because D:\RemoteFTP now acts as my root directory so FTP server will start looking from root directory.Similary in the admin console we need to make some changes as shown below



Update your deployment and test this issue again by putting a file in the FTP location and you will get an instance in em console.

In SOA suite 11.1.1.2 there is an issue with FTP adapter

It gets failed with following exception

Caused by: BINDING.JCA-12563
Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'execute' failed due to: JCA Binding Component connection issue.
JCA Binding Component is unable to create an outbound JCA (CCI) connection.


Caused by: javax.resource.spi.ApplicationServerInternalException: Unable to get a connection for pool = 'eis/ftp/FTPAdapter', weblogic.common.resourcepool.ResourceDeadException
at weblogic.connector.outbound.ConnectionManagerImpl.getConnectionInfo(ConnectionManagerImpl.java:394)
at weblogic.connector.outbound.ConnectionManagerImpl.getConnection(ConnectionManagerImpl.java:307)
at weblogic.connector.outbound.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:115)
at oracle.tip.adapter.ftp.FTPConnectionFactory.getConnection(FTPConnectionFactory.java:98)
at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAConnectionManager$JCAConnectionPool.createJCAConnection(JCAConnectionManager.java:1355)


this error occurs as connection pool gets exhausted.The FTP adapter keeps the exhausted in the connection pool and do not release it causing in a weblogic.common.resourcepool.ResourceDeadException

I checked this issue in SOA Suite 11.1.1.4 and i didn't faced any issue.

2 comments:

Anonymous said...

I am using UNIX machine as FTP server but i am not able to see any instance created when i put the data in the remote ftp location.

Please suggest.

Anonymous said...

Can you post an article on SFTP and FTPS,There is not much document available for them