cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter module not getting called

Former Member
0 Kudos

Hi All,

I develop a adapte module ear and deployed it with SDM, but while running the interface module is not getting called. I have crated CreateAttachment adapter module example available on SDN, and have added traces but no message is coming in audit log of adapter.

what could be the reason?

the code is

package sample;

/**

  • @author rsn

*

  • To change the template for this generated type comment go to

  • Window>Preferences>Java>Code Generation>Code and Comments

*/

import javax.ejb.CreateException;

import javax.ejb.SessionBean;

import javax.ejb.SessionContext;

import com.sap.aii.af.mp.module.Module;

import com.sap.aii.af.mp.module.ModuleContext;

import com.sap.aii.af.mp.module.ModuleData;

import com.sap.aii.af.mp.module.ModuleException;

import com.sap.aii.af.ra.ms.api.Message;

import com.sap.aii.af.ra.ms.api.TextPayload;

import com.sap.aii.af.service.auditlog.*;

/**

  • @ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>

  • @ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>

  • @ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>

  • @ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>

  • @stateless

*/

public class CreateAttachment implements SessionBean, Module{

private SessionContext myContext;

public void ejbRemove() {

}

public void ejbActivate() {

}

public void ejbPassivate() {

}

public void setSessionContext(SessionContext context) {

myContext = context;

}

public void ejbCreate() throws CreateException {

}

public ModuleData process(ModuleContext moduleContext,ModuleData inputModuleData) throws ModuleException {

// create a second attachment for the receiver mail adapter

try {

// get the XI message from the environment

Message msg = (Message)inputModuleData.getPrincipalData();

AuditMessageKey amk = new AuditMessageKey(msg.getMessageId(),AuditDirection.INBOUND);

Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"CreateAttachment: Module called");

// create a new payload

TextPayload attachment = msg.createTextPayload();

// provide attributes and content for the new payload

attachment.setName("Attachment");

attachment.setContentType("text/plain");

attachment.setText("Hello World");

// add the new payload as attachment to the message

msg.addAttachment(attachment);

// provide the XI message for returning

inputModuleData.setPrincipalData(msg);

} catch (Exception e) {

// raise exception, when an error occurred

ModuleException me = new ModuleException(e);

throw me;

}

// return XI message

return inputModuleData;

}

}

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Problem resolved.

Former Member
0 Kudos

Hi Ranjeeth,

Even I had same issue...after lot of debugginh realise path specified in CC for calling adapter module was incorrect...please check if you are pointing to correct location where you have deployed your module...

Check this doc here:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d7...

According to it, if you properly configure the ejb-j2ee-engine.xml file, then you'd call your module using "localejbs/<JNDIName>".

Hope this will help.

Nilesh

Former Member
0 Kudos

Hi Stefan and Nilesh,

The issue is resolved now. I have developed a fresh module and it worked with out any issue. This time I didnot stateless session bean by developer studio instead I directly create the java class and pasted the bean entry..and it worked.

Thanks for inputs.

Ranjeet Singh.

stefan_grube
Active Contributor
0 Kudos

This module is designed for the receiver mail adapter.

If you put the JNDI name of the module to the module tab of the communication channel, there should be at least an error message in the audit log, when the module is not found. Is this the case?

Regards

Stefan