cancel
Showing results for 
Search instead for 
Did you mean: 

Custom adapter module throwing exception

Former Member
0 Kudos

Hi,

We have written an adapter module (EJB) to convert a file structure into XML for conversion in XI. Using file adapter(FTP), we are getting the files converted into XML without any problem. However, when there is no file in the directory the module is throwing an exception and writing an entry into the log (polling interval is 1 minute).

The requirement is when there is no file in the directory, the adapter should keep on polling, but without generating any exception or making an entry in the log.

Can anyone help out with this please?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

Are you having logic in the code to handle such a situation?

Why dont you handle it in the Catch section of your try block

I believe you are getting a null pointer exception right???

regards

krishna

Former Member
0 Kudos

Hi,

right now the code checks if a file is present, else generates a file not found exception. My objective is that no exception should be generated.

Answers (3)

Answers (3)

bhavesh_kantilal
Active Contributor
0 Kudos

By any chance in the Adapter Module are you performing a File IO to read a file from some location?

Regards

Bhavesh

Former Member
0 Kudos

Hi,

No I have not performed any File IO to read the file from the specified directory.

I have used ModuleContext and ModuleData and then used

Message msg = (Message) inputModuleData.getPrincipalData(); to retrieve the data.

Former Member
0 Kudos

strange...

if a file is not found in the specified directory where your file adapter is polling, it is not possible that the control comes to the adapter module you have specified in the module chain.

have you done something unusual in your CC config i.e. added only your module in the module chain and removed CallSAPAdapter

Former Member
0 Kudos

Generally the file adapter polls continuosly even if there is no file. Since you are using file not found exception hence the exception. So i would suggest that do not throw any exception. let the file adapter keep polling.