Wednesday, May 28, 2008

Oracle AS ESB File FTP Adapter Part 2

Continued from Part 1:

With not much log message to go on when configuring ESB SFTP adapter, I decided to try BPEL SFTP adapter to see if that yields more hints. The strategy seems to help pinpoint the problem.

Here is the BPEL SFTP error msg in log:


JCA: Uncaught exception
oracle.classloader.util.AnnotatedNoClassDefFoundError in
JCA-work-instance:FTP Adapter-4 - cause:

Missing class: com.maverick.ssh.SshTransport

Dependent class: oracle.tip.adapter.ftp.SshImpl.SshImplFactory
Loader: FtpAdapter:0.0.0
Code-Source:
/C:/oracle/product/10.1.3.1/OracleAS_1/j2ee/home/connectors/FtpAdapter/FtpAdapter/ftpAdapter.jar
Configuration: <code-source> in
C:\oracle\product\10.1.3.1\OracleAS_1\j2ee\home\connectors\FtpAdapter\FtpAdapter

The missing class is not available from any code-source or loader in
the system.

The forums.oracle.com has one entry that mentioned that for Oracle AS B2B package, there is a patch # 6353697 available for getting SFTP to work. It makes one think that it is what I needed too but I got to find the confirmation and the right patch. After setting up access to Oracle Metalink, I came across an entry that points to the patch (# 5852001) I need. Since my SOA window install has different path setup, I have to correct the referred path in the patch before applying it. I am glad the final outcome is a success!

There are more things to try for the File/FTP adapter.

1. Test the Synchronous Read File operation, which reads the current contents of a file.

2. Test different options for when to write to new file. The factors are: Number of Messages, Elapsed Time, and File Size.

3. With FTP adapter, there are different methods for obtaining the modification time of files on the remote FTP server. I am able to use File System command “quote mdtm filename”, I need to experiment with Directory Listing and File Name Substring. For now, there is no time zone issue, since the time zone of the FTP server is same as the SOA instance.

4. We could use Public Key option to connect to SSH server.

Oracle AS ESB File FTP Adapter Part 1

We are prototyping how Oracle ESB File Transfer with Transformations works. This involves setting up File adapter and FTP (SFTP) adapter.

As always, I like to tackle a smaller piece before moving on. So I went with setting up ESB File adapter first.

Getting ESB File adapter set up is pretty smooth experience. Most of the time was spent on figuring out the exact off set for fix-length file transformation. Setting up ESB File adapter allows me to see how Oracle AS supports Unicode and what file format it supports. The Unicode test is successful. The native format builder works well with CSV file, fixed-length file. ESB console provides Processing Time statistics for each process.

I started out creating a schema file for validating incoming file format. I created a sample file (comma delimited) “sample_input_files\Student_Records_File_utf.csv” which contains all the fields that both output files require, and then feed this sample file into the Native Format Builder.

I then created a schema file for validating outgoing Josten system file format. I created a sample file (comma delimited) “sample_files_for_create_schema\Josten_File.csv” and then feed this sample file into the Native Format Builder. The output file produced is comma delimited Josten_TIMESTAMP.xls.

I also created a schema file for validating outgoing ParisDegree system file format. I created a sample file (fix length) “sample_files_for_create_schema\PARIS_Degree_File.txt” and then feed this sample file into the Native Format Builder. The output file produced is fix length delimited paris_degree_TIMESTAMP.txt.

Now it is time to move on to ESB FTP adapter.

Oracle FTP adapter documentation only provides instruction for setting up FTPS, which is not widely used anymore. UMS doesn’t have any FTP SSL in-house. After more googling and checking around, I decided to fiddle with the $ORACLE_HOME/j2ee/home/application-deployments/default/FtpAdapter/oc4j-ra.xml settings. I discovered that there is option to set useSFTP.

Instead of setting up a SSH server, I decided to test against Trillian SSH server.
The test is done with ESB FTP adapter. I turned on the logging output level to finest for oracle.tip.esb.server.service.impl.inadapter, That is very helpful.

The result is:
I am able to connect using FTP but getting some handshaking errors using SFTP. I checked the SSH config setting on trillion, it seems to allow publickey or password as AllowedAuthentications. I choose using password since it is easier to set up. The error I am getting is:
JCA: Settting up the SFTP connection with Transport provider=[socket]
JCA: Postcall, Closing managed connection.
JCA: The connection variable is null in postCall. This could be because of a call postCall w/o a preceeding call to preCall”

Continued to next blog article...