cancel
Showing results for 
Search instead for 
Did you mean: 

Error When Executing Custom Adapter Module

Former Member
0 Kudos

Hello Experts,

We are developing a custom adapter module for picking the files through SFTP, sorting and placing in destination.

The scenario is as below:

1. All the files will have a Date attached to its name.

2. Our adapter module should read the files on a particular path through SFTP, and sort based on the date (provided in the file name).

3. Put it in another folder over SFTP

We have a written a Custom adapter module for this task.

Inside this module, we are getting parameters that are required for connecting to SFTP like username, password, host, port, etc... All these parameters are also passed from module configuration.

While picking the files from a source directory, in communication channel level, it is showing the below error

cannot send message to module processor:com.sap.aii.af.lib.mpmodule.moduleException: one of the parameter is null.

Error while sending message:cannot send message to module processor:com.sap.aii.af.lib.mpmodule.moduleException: one of the parameter is null.

We have placed some Audit.addAuditLogEntry and wrote some messages right from the beginning. Even these messages are not visible

We are not sure whether the error is from the custom adapter module or whether it is not executing the adapter module itself. We are not sure how to proceed further.

Your help on this highly appreciated

Accepted Solutions (0)

Answers (2)

Answers (2)

apu_das2
Active Contributor
0 Kudos

Hi Sujai,

Is your requirement is to read files in sorted order ?

If it is the requirement then I don't think that you need an custom module for this. Just try with picking the file configuring the CC - Record Set sequence as ascending order.

Thanks,
Apu

manoj_khavatkopp
Active Contributor
0 Kudos

Apu,

Record Set sequence is used when you are doing FCC with structured level.


Br,

Manoj

lokeshwar
Explorer
0 Kudos

Hi Manoj,

Ascending by date

It will pick the files based on the date that they have been placed in the SFTP path but not on the date provided in the file name.

whereas the requirement is to pick the files based on the date that they been provided in the file name itself.

apu_das2
Active Contributor
0 Kudos

Hi Manoj,

Are not you using SFTP adapter?

In SFTP adapter, you don't have to select FCC to select processing sequence I guess. Check once.

Thanks,

Apu

manoj_khavatkopp
Active Contributor
0 Kudos

May i know what is the file name schema to be picked ?

lokeshwar
Explorer
0 Kudos

Hi Manoj,

This is the file name schema to be picked.

Circle_DLY_PRE_222_EXCLUSION_20160715.txt

Here the circle may vary.

manoj_khavatkopp
Active Contributor
0 Kudos

Lokesh ,

Well i am out of suggestions of suggestions , but below are my points :

  • I doubt if creation of custom module also suffies this requirement or not , as i mentioned earlier modules will be called only after file is picked.

  • See if this can be handled by Scripts before file processing.

Br,

Manoj

Former Member
0 Kudos

Apu Das wrote:

Hi Sujai,

Is your requirement is to read files in sorted order ?

If it is the requirement then I don't think that you need an custom module for this. Just try with picking the file configuring the CC - Record Set sequence as ascending order.

Thanks,
Apu

No Apu... My requirement is there will be a set of files placed in a particular directory. I need to pick those files, sort them based on the date (which is specified in the file name itself), and place it in the sorted order in another folder

lokeshwar
Explorer
0 Kudos

Hi manoj,

In communication channel level it is picking the file from source directory but it's not able to send to module processor.

Ryan-Crosby
Active Contributor
0 Kudos

Hi Sujai,


Sujai Kaarthik wrote:

sort them based on the date (which is specified in the file name itself), and place it in the sorted order in another folder

I'm confused by this statement here - how does a folder have a sorted order?  A folder is simply a place in the file system that contains data and there is no order.  Also, what do you do for the case when multiple files have the same date?

Former Member
0 Kudos

Hi Ryan,

Of course I agree with you that folder can have files in any order. But it will store in the order that we put it into them right? That is why file name is going to have dates on it.

In our case, the file content will be some data related to a particular geographical area for one particular day. A file name will not have only dates on it. For example, a file name will <AreaCode>_<AreaName>_<Date>. Like this, they may place multiple files for different geographical areas and different dates.

As for the case if we have 3 files with names as say IND_TN_20160802, IND_TN_20160801 and USA_LA_20160802, I can place the 2 files (IND_TN_20160802 and USA_LA_20160802) in the target directory in any order after I am done with moving the file IND_TN_20160801 first to the target directory.

Ryan-Crosby
Active Contributor
0 Kudos

Hi Sujai,

If you are referring to making sure that files are "lastModified" in the order you want then that would make sense.  But in the end the folder still has no order to how it is stored...

Regards,

Ryan Crosby

manoj_khavatkopp
Active Contributor
0 Kudos

I would suggest you to test the Module local refer below blog.

Former Member
0 Kudos

Hello Manoj,

When we see the nwa logs, we are getting the below text:

Severity:  Error

Category: Single Click Filter by Category  Negative Single Click Filter by Category  com.sap.aii.adapter.sftp.ra.rar.jca.SFTP2XI

Location: Single Click Filter by Location  Negative Single Click Filter by Location  com.sap.aii.adapter.sftp.ra.rar.jca.SFTP2XI.sendMessageFromSftp(byte[] file, FAttributes fileAtts, HashMap attachments, Channel channel, Connection con, String home)

Data Source:   j2ee/cluster/server0/log/defaultTrace_00.trc

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Sujai,

We cant make sure what parameter is missing according to the log.

This is the reason why i refereed the above blog  so that you can test locally in your NWDS/Desktop and then you may deploy the module in PI. It will be quick and easy way to test the custom module.

But as per the requirement mentioned in this thread

If you need to pick the files on current date you may check below threads : Because even though you create custom module the modules are called once the file are picked

How to pick up the file based on Current date ? | SCN

Br,

Manoj

manoj_khavatkopp
Active Contributor
0 Kudos

Try if this satisfies your requirement.

With duplicate check enabled.