on 11-07-2007 5:48 PM
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;
}
}
Problem resolved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.