Exception in XI sender mail adapter
Hi,
XI sender mail adapter raised the following exception when it was fetching emails from a mailbox on a MS mail server while these mails were sent from a unix system.
Adapter-Error: exception caught during processing mail message [1]com.sap.aii.messaging.lang.com.sap.aii.messaging.lang.BinaryIndexOutOfBoundsException: Binary index out of range: -3
However if I sent the same attachment to the same mailbox from yahoo the XI sender mail adapter can process it correctly.
I would appreciate if somebody could share his/her expertise or experience regarding this issue.
Many thanks.
Zhongliang
I dont think this has got something to do with Unix or Windows system. As per the exceptions is considered, it says that, index out of range, which can occure in cases, by the time it was about to process the next mail, it could have been deleted or moved to some other folder..
VJ
Similar Messages
-
Sender Mail Adapter Error: exception caught during processing mail message;
HI , I am configuring mail to file scenario. Need to read mail content (no need to capture From,TO or Subject details) and create a file with the content in the mail.
Need to read mails from microsoft outlook. Exchange server has been configured for POP3 protocol.
Following are the details provoding in sender mail adapter:
URL: provided url in the format: pop://<server name>
Authentication method: plain
provided user credinetions to access mails.
poll interval - 1min
content encoding none.
processing parameters : quality of service-exactly once
Since there is no need to capture From,TO or Subject details, didn't select the option - use mail package.
Verified for unread mails in the mail box and made sure that there are few unread mails.
Also, created data types and other components in IR and completed mapping.
But after starting sender mail communication channel, getting error "exception caught during processing mail message; java.lang.NullPointerException" in RWB-adapter-communication channel monitoring.
please let me know what needs to be done to resolve this error.
Thanks.HI Stefan, i tried, but still it is giving same error. Yes, i am able to access outlook mail with the user credentials given in the communication channel to access exchange server.
I am using message protocol: xipayload . Also since i dont have to capture TO,from,subject details., created data type just with one element of type string, not in the standard format .Does this makes any difference. -
Hi,
I am working on Sender Mail Adapter. I have done the total configuration but unable to sucess the scenarios. In the CC monitoring, it is saying that "Not Intialised" Even though i send and receive the messages from My Lotus Notes Inbox. I activated all the objects.
I have done the following examples:
Transport Protocal: POP3
Message Protocal: XIALL
Given the URL and UserId and PWD also
Poll Intevel: 1 (Mins)
Adapter Status: Active
Please help to me solve this problem. I already raised the one more thread today but didn't get solutions.
<b>Note: Do i need to do any setting from the Lotus notes(Mail Server) to diver my messages.</b>
Thanks in Advance,
<b>I found the problem with SMTP Address. Can i use the SMTP Url for POP3 or IMP4 protocal. Is there any thing else because if i use the Same SMTP Address, it is giving exception</b>
Best Regards,
Vijay
Message was edited by:
Gangisetty Vijaya Bhaskarudu
Message was edited by:
Gangisetty Vijaya BhaskaruduHi Gangisetty,
SMTP is the out going server(for sending mails out) while POP3 is the in coming(receiving mails) server. So for a sender channel, you need to use the POP server details not SMTP.
cheers
danus -
Sender Mail Adapter - forcing content as an attachement
Hi all,
We are using the Sender Mail Adapter to pull emails from the inboxes of some users of an exchange server. We use the Mail Package option.
We have noticed that the content of the emails are by-default added as attachments when there are no real attachments to the emails. However the content is not added as an attachment when one or more attachments are present in these emails.
Is there a way of forcing the Sender Mail Adapter to always add the content as an attachment and keeping the other attachments as well? and of course maintain the Mail Package message type as the main payload...?
Many thanks,
AldoHi Stefan,
Thanks for your reply. I am glad to hear that I am wrong again )
In your opinion is it possible to force the Outlook Exchange server to add the content attachment every time? I mean by doing some configuration on it...?
The reason why we would like to do this is because when - in the content tag of a Mail Package message - we have MIME message parts that are of content-type text/html we are having problems in decoding the html back to a readable format.
To do this we use the apache QuotedPrintableCodec Java class.
This works fine when the content type of the message is just text/plain but we get an exception when we try with text/html.
The exception we get is:
org.apache.commons.codec.DecoderException: Invalid URL encoding: not a valid digit (radix 16): 13
I don't know if this is because of the two character sets we have in the payload (utf-8 and iso-8859-1) or if it is for other reasons...
If you could help me figure out how to forward any HTML email to another system in a readable format it would be great.
Thanks for your support,
Aldo -
Sender Mail adapter encounters MalformedInputException
I have a sender mail adapter that processes the attached .csv file. All is working fine. I use FCC in module to convert the attachment and pass to an IDOC adapter for processing in SAP system.
My problem is sometimes the sender mail CC fails with ...........
exception caught during processing mail message[1]; com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
It only fails with some files. At the moment when we test we FORWARD the email to our email account. If I detach the failed email attachment and attach it to a NEW email it will then work.
So why does it not work when forwarding emails? But it works when I attach the same file to a new email and send?
Other threads for this error seem to point to encoding. But how do I know which to use. I currently use the following in my module config:
Transfer.ContentType application/octet-stream;charset="ISO-8859-1"I have this in my configuration:
localejbs/AF_Modules/PayloadSwapBean on local
TRANSFORM
localejbs/AF_Modules/MessageTransformBean on local
txtxml
TRANSFORM swap.keyName payload-name
TRANSFORM swap.keyValue MailAttachment-1
txtxml Transfer.ContentType application/octet-stream;charset="ISO-8859-1"
txtxml Transform.Class com.sap.aii.messaging.adapter.Conversion
txtxml Transform.ContentDescription MailAttachment-1
txtxml Transform.ContentDisposition attachment;filename="MailAttachment-1.bin"
txtxml xml.conversionType SimplePlain2XML
txtxml xml.documentName MT_BCD_INVOICES
txtxml xml.documentNamespace urn://federalmogul.com/BCDTRAVEL/FINGLOBCD001/00
txtxml xml.fieldNames COST_CENTRE,EMPLOYEE_ID,PRODUCT_GROUP,COMP_CODE,BCD_ACCOUNT,INVOICE_DATE,TRAVELER_NAME,TRAVELER_FIRST_NAME,INVOICE_NO,AMOUNT_EXCL_VAT,CURRENCY1,AMOUNT_VAT,CURRENCY2,AMOUNT_DOC_CURRENCY,CURRENCY3
txtxml xml.fieldSeparator ;
txtxml xml.lastFieldsOptional YES
txtxml xml.processFieldNames fromConfiguration
txtxml xml.structureTitle RECORDSET -
Hi All,
We are getting this error in Sender Mail adapter.
"exception caught during processing mail message; java.net.ConnectException: A remote host refused an attempted connect operation"
It is a (Lotus Notes) Mail to File scenario.
Used POP3, and gave the URL as POP:// ** .
I have tried pinging the server and getting a good response.
I have also tried the OS01 ans it returned a response : Program Terminated.
I am not sure if the POP3 port is enabled.
Are there any check points we are missing ?
Please throw some light on this as we need to solve this asap ..
Yashwanth
Edited by: YashwanthSVK on Aug 2, 2011 7:18 PMShabarish is right.
This seem a connectivity issue. Try to ping Mail server from your PI System and check pop3 port.
This document can be helpful for you:
http://wiki.sdn.sap.com/wiki/display/XI/SMTPConfigurationinSAPXI -
Sender Mail Adapter - java.lang.NullPointerException in CC monitoring
hi,
I configured my Sender Mail Adapter correctly.
I have the correct POP URL, authentication. I'm not using PayloadSwapBean right now.
I can't get rid of the exception inside my Channel monitoring.
exception caught during processing mail message; java.lang.NullPointerException
does anyone know why?
I've been told the POP account has emails already.
I will try to create an outlook account for this POP e-mail account in the mean time to see the e-mails.
Thank youthanks aaron.
I don't see the folder ./SYS/../j2ee/...
will it be under another folder? I don't see a trace log folder either.
I think the problem might be in the Module tab.
I tried.
AF_Modules/PayloadSwapBean
localejbs/AF_Modules/PayloadSwapBean
/localejbs/AF_Modules/PayloadSwapBean
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
/localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
they all produce the same error. I wonder if these Beans actually exist.
I think we might have to reinstall this Mail Adapter altogether.
Or maybe it's really the connection to the Mail Server. But would it display this kind of message.
This is what I'm looking at.
Also, i had to use this URL
pop://server:995/
(995 is using SSL and it is the default port). When I use this, I see the Java Null Pointer Exception a lot less frequently. Weird. -
Error when using Variable Transport Binding in Sender Mail Adapter
Hi,
I am using the Sender Mail Adapter to receive an email, convert the attached tab delimited text file into xml and map it to an IDOC.
I am using PayloadSwapBean and MessageTransformBean in order to do this, and this all works perfectly.
I am now trying to access the Adapter Specific Message Attributes to retrieve the SHeaderFROM attribute from the message and map it to a field in the idoc.
However when I check the "Variable Transport Binding" option in the Advanced tab of the mail adapter, the message no longer goes through to SXMB_MONI and I get the following error in the Java logs.
Transmitting the message to endpoint http://sapserver:53500/sap/xi/engine?type=entry using connection AFW failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Received HTTP response code 500 : Error during parsing of SOAP header.
Any ideas why this is happening?
Thanks,
BradHi Luciana,
Honestly, I cant really remember how or if it was resolved and I was just helping out on the issue, but another consultant continued with it, so unfortunately I cant be any help on this.
Good luck!
Cheers,
Brad -
Sender Mail Adapter - CC Error
Hi,
My scenario is Mail>XI>Proxy(R/3).
The sender mail adapter checks the e-mail box and procces into XI.
I'm getting the following error in the CC:
"exception caught during processing mail message, java.lang.ArrayIndexOutOfBoundsException 0 > = 0"
But, this error is only present when the client try to sent the e-mail data, If i resend the same e-mail manually it works perfectly ( Which led me to think that the CC configuration is correct ).
I'm not ruling out any outlook issue.
Do you guys have experiencied this kind of issue?
Thanks.Thanks Satish,
I'm sending the same e-mail. (manually works, automatically don´t work)
Also, I can´t see the result of the payload because the error is in CC and only shows that error.
Configuration CC:
Transport Protocol: POP3
Message Protocol: XIPAYLOAD
URL, User,Pass...
Encoding : base64
Quality of service: Exactly Once
- Any suggestions? -
Sender mail adapter : no messages and no error log
Hello,
I have configured a sender mail adapter to read mails from the inbox. I have used IMAP protocol. URL is specified as imap://EMHBSEXM01/Inbox. User name and password is also specified properly. I have kept poll interval to 1 minute. Messages in the inbox are in unread status. But the mail is not getting processed. I do not see anything after 1 minute. I tried using generate fetch report flag. But even then it does not create any message in SXMB_MONI. I checked runtime workbench for Mail adapter but I do not see any message for the same. Is there something that I am missing?
Thanks,
DevHi All,
I chekced your responses and tried accordingly. Our basis team has given me new link now and the error message has changed. I am getting following error message.
exception caught during processing mail message; java.io.IOException: unexpected login response; read 001F BAD Command received in Invalid state.
Does anyone have any idea what this error is?
Thanks in advance,
Devendra -
Sender mail adapter - filter emails by attachment?
Dear experts,
I have a sender mail adapter that picks an XSL (EXCEL) attachment from an incoming email and converts it (with a custom adapter module) to XML.
But now how can I make the adapter only process emails with XLS - attachments? In that Inbox I also have emails with HTML-attachments for example. And now my adapter also wants to process those messages.
In my adapter module that makes XLS to XML I see an exception in RWB but the message still gets through to SXMB_MONI where it gets stuck with a red flag.
Can I somehow tell the adapter to only process emails with XLS attachments?
Or can I stop the processing in the adapter module that converts XLS to XML?
Thank you for any input or ideas on this!
Best regards,
Peter
PS: I am using this code to convert XLS to XML:
http://wiki.sdn.sap.com/wiki/display/ABAP/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+ColumnsHello ChizzT,
Thank you for your idea. I went with this one and it worked.
Best regards,
Peter -
Sender Mail adapter get no mails
Hello,
we are using the sender mail adapter to receive mails (IDOCS) from a Exchange server.
A few days it works, but suddenly no mails are received.
But in RWB the mail adapter status is green and shows, that there are no new mails. But when I check the mail box with OUTLOOK, there are some mails.
When I deactivate and activate the mail adapter, all mails are read then.
Pollinterval: 1 minute
XI: SP10
Who can help me are had s similar problem?
Or is it possible to stop/start the mail adapter (or the adapter engine) automaitcally (more like a workarround)
best regards
Werner MagerlHi All,
I chekced your responses and tried accordingly. Our basis team has given me new link now and the error message has changed. I am getting following error message.
exception caught during processing mail message; java.io.IOException: unexpected login response; read 001F BAD Command received in Invalid state.
Does anyone have any idea what this error is?
Thanks in advance,
Devendra -
Sender Mail Adapter configuration connection timed out
Hi All,
I am setting up a simple sender mail scenario to test if my mailadapter works.
But I receive a error message in the Sender Communication Channel I receive this error:
"exception caught during processing mail message; java.net.ConnectException: Connection timed out: connect"
I tested File Sender to Mail Receiver Scenario it worked fine.
But Sender Mail to File Receiver is not working and giving above exception.
Mail Sender SetUp
pop://xx.xxx.xx.xx
In User and Password I have given my Lotus Notes Server user & password credentials
Pls suggestHI Rachit,
Have you seen the thread
Sender Mail Adapter
There it is mentioned that the Lotus notes mail id shoudl be POP3 enabled. Try doing that
Regards
Suraj -
Error during configuration of Sender Mail Adapter
Hellow All,
I was trying to configure Sender Mail Adapter and I am getting this error.
<b>error occured: exception caught during processing mail message; java.io.IOException: unexpected greeting response; read 220 mailrelay2.lntinfotech.com ESMTP Service (Lotus Domino Release 6.5.5) ready at Fri, 14 Jul 2006 16:11:29 +0530</b>
Can anybody please suggest me why this error is occured and how to solve that?
I am waiting with points, come on
Thanks in advance,
SugataHI,
1)Try to do with POP3
2)Check the URL , give correct Exchange Server Name/IP address.
3) Hope you have access to read the inbox (sometimes it will not be there)
Than try it.
Regards.
Moorthy -
Sender mail adapter - attachment name
Hi there
We have configured a sender email adapter to receive text/csv attachments and save them to a file system. What we are having a problem with is reading the attachment name. So we are using Dynamis Configuration to create the file name using the subject line - Which is not ideal. Ideally we would like to use the same name as the origianl attachment but haven't found any way of doing that. We even tried using Content-type in the Variable Header (XHeaderName1) suing variable transport binding but it doesn't show up in the Dynamic Config part of the SOAP message.
Is there any way of reading the name of the file attachment? We are on PI release 7.0.
Any help would be appreciated.
Cheers
SalilHi Vitor
There are 2 scenarios that I can think of -
1. You are saving the email attachment as a file. In that case use step 3 in the earlier reply to get the attachment name and save the file witht that name.
2. You are sending the XML straight to a receiver using HTTP, IDOC, JDBC etc. in which case you would need the attachment name much earlier that step 3. For that I guess you would have to write another adapter module on the sender mail adapter(at Position 3 where position1 = payloadswap bean, 2 = custom module to get the attachment name) and add an xml tag to your incoming message. These adapter modules are really powerful and are like user exits in ABAP. In that case you would have to change the Data Type in the Integration repository to reflect that extra tag. Here is some code from a module we wrote to totally change the structure of the xml coming in. The key thing to remember is this module is that you can read the whole message byte by byte. There might be smarter ways of doing it (like using the SAP XML parser factory class) but since I'm not a Java programmer I stuck to the basics. Here's the code( you could also look at the example given in sap help where they remove (or add I'm not sure) CR(carriage return) from CRLF (CR Line feed).
Created on Aug 8, 2007
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package jdbcPackage;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
@author Salil.Mehta Soltius NZ Ltd
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
public class jdbcClass 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 {
// put your code here
try {
Message msg = (Message) inputModuleData.getPrincipalData();
XMLPayload payload = msg.getDocument();
String payEnc = payload.getEncoding();
byte[] payByte = payload.getContent();
byte[] payByteOut = new byte[payByte.length];
byte[] payByteTemp = new byte[payByte.length];
int i;
int j;
int actualCount = 0;
char xmlTagFound = ' ';
char endXmlTagFound = ' ';
char tagFound = ' ';
System.arraycopy(payByte, 0, payByteTemp, 0, payByte.length);
// Step 1 - Conversions
// convert "< to <" and "> to >"
// convert " to "
// This will remove any carriage returns and line feeds
// and the <XML* and </XML* tags plus the <row> and </row> tags
for (i = 0; i < payByte.length; i++) {
// convert < to < and > to >
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'l') {
if (payByteTemp[i + 2] == 't') {
if (payByteTemp[i + 3] == ';') {
payByteTemp<i> = '<';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'g') {
if (payByteTemp[i + 2] == 't') {
if (payByteTemp[i + 3] == ';') {
payByteTemp<i> = '>';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'q') {
if (payByteTemp[i + 2] == 'u') {
if (payByteTemp[i + 3] == 'o') {
if (payByteTemp[i + 4] == 't') {
if (payByteTemp[i + 5] == ';') {
payByteTemp<i> = '"';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
payByteTemp[i + 4] = '\n';
payByteTemp[i + 5] = '\n';
// This will take in the initial xml declaration from the Byte array
// And we also don't want the stuff after the xml declaration till
// we reach the first <row> tag
if (xmlTagFound == ' ') {
if (payByteTemp<i> == '>') {
xmlTagFound = 'X';
payByteOut[actualCount++] = payByteTemp<i>;
if (xmlTagFound == 'X') {
payByteOut[actualCount++] = '\r';
continue;
if (xmlTagFound == 'X') {
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'r') {
if (payByteTemp[i + 2] == 'o') {
if (payByteTemp[i + 3] == 'w') {
if (payByteTemp[i + 4] == '>') {
xmlTagFound = 'Y';
} else {
continue;
} else {
continue;
} else {
continue;
} else {
continue;
} else {
continue;
// Carriage return and line feed
if ((payByteTemp<i> == '\r') || (payByteTemp<i> == '\n')) {
continue;
// <XML_*> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'X') {
if (payByteTemp[i + 2] == 'M') {
if (payByteTemp[i + 3] == 'L') {
tagFound = 'X';
endXmlTagFound = ' ';
continue;
// </XML_*> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == '/') {
if (payByteTemp[i + 2] == 'X') {
if (payByteTemp[i + 3] == 'M') {
if (payByteTemp[i + 4] == 'L') {
tagFound = 'X';
endXmlTagFound = 'X';
continue;
// <row> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'r') {
if (payByteTemp[i + 2] == 'o') {
if (payByteTemp[i + 3] == 'w') {
if (payByteTemp[i + 4] == '>') {
tagFound = 'X';
continue;
// </row> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == '/') {
if (payByteTemp[i + 2] == 'r') {
if (payByteTemp[i + 3] == 'o') {
if (payByteTemp[i + 4] == 'w') {
if (payByteTemp[i + 5] == '>') {
tagFound = 'X';
continue;
if ((payByteTemp<i> == '>') && (tagFound == 'X')) {
tagFound = ' ';
continue;
if (tagFound == ' ') {
if (endXmlTagFound == 'X') {
continue;
payByteOut[actualCount++] = payByteTemp<i>;
byte[] payByteExp = new byte[actualCount];
System.arraycopy(payByteOut, 0, payByteExp, 0, actualCount);
payload.setContent(payByteExp);
msg.setDocument(payload);
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
ModuleException me = new ModuleException(e);
throw me;
return inputModuleData;
Maybe you are looking for
-
I did not deactivate a photoshop cs6 before there was a new "C" hard drive installed on my computer and a Win7 Pro fresh install too. How can I activate photoshop on the new hardware if I can't deactivate it on the old hardware that is no longer avai
-
Cross-Company Sales and Billing doesn't call BUV transaction settings
Hello Dear Experts. Please help me with the following issue: 1) The Company consists of Headquater and branches (one legal entity) - several Company codes are set in the system for each unit. 2) The Contract for deliverying goods/implementation servi
-
Matrix Report in XML Publisher
Hi, I have a requirement to develop a report through XML publisher. Can anybody tell me the steps to do ? I don't know XML Publisher. Thanks in Advance, Pradeep
-
HT4623 can the first gen ipad mini be updated to ios 7?
Looking to get an ipad mini for my son. He doesnt need to get on with the retina display but i want to be able to update still. Is the first gen mini able to be updated to ios7?
-
Limited Number of visible slides in TOC?
Hi, I have a project with 22 slides marked as visible in my TOC. When I preview the project, TOC items 1-19 navigate to the slide correctly when I click on them, but items 20-22 don't do anything. Is there a limit to the number of items that will wor