cancel
Showing results for 
Search instead for 
Did you mean: 

JCO_SYSTEM_FAILURE

Former Member
0 Kudos

Hi Experts,

I am doing scenarion as File to Mail. Sender if file adapter and receiver is Mail adapter.

I have to send the files from SAP APP server to the thirdparty mailid.

I have done Java Mapping in NWDS and succssfully tested.

But when XI is picking up the file i can find error in SXMB_MONI and if i cancel or retart the message then all the next messages are scheduled for outboun processing and again if i cancel the first message then cancelled/restarted message is getting into Error given below.

Two types of Error as follows.::

First Type Error is::

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="MAPPING">JCO_SYSTEM_FAILURE</SAP:Code>

<SAP:P1>program state check for conversation 20367542 / CPIC-CALL: 'ThSAPCMRCV' : cmRc=2</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>&quot;SYSTEM FAILURE&quot; during JCo call. program state check for conversation 20367542 / CPIC-CALL: 'ThSAPCMRCV' : cmRc=2</SAP:Stack>

<SAP:Retry>A</SAP:Retry>

</SAP:Error>

Second Type of Error is::

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="MAPPING">JCO_COMMUNICATION_FAILURE</SAP:Code>

<SAP:P1>Error when opening an RFC connection</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>&quot;COMMUNICATION FAILURE&quot; during JCo call. Error when opening an RFC connection</SAP:Stack>

<SAP:Retry>A</SAP:Retry>

</SAP:Error>

Can any one suggest what would be the problem.

Is this is from Technical part or from Basis part.

Please suggest.

Thanks

Swetha

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sewtha reddy,

The mapping request for a messages involves more than one runtime steps. The very first step will be Integration Engine that will send request to Gateway using RFC AI_RUNTIME_JCOSERVER, there the process picks up 'registered program ID' which is J2EE Engine. so based on program ID the request (mapping) will be forwarded to J2EE enginer by making a JCo call. As this thumb rule, your messages is failling when it's calling this RFC. So please ensure you have below items in place.

1. Check the rfc AI_RUNTIME_JCOSERVER using SM59 transaction working fine.

2. If not, check The program ID being used in this rfc has been defined in your NWA/Visual Admin for service 'Jco Connection'

3. If 1 & 2 are fine, then check you your dev_rfc* and std_server*. for string "AI_RUNTIME" then it's highly advised to 'restart your J2ee engine.

I hope this help you to understand the basic need of this rfc and corrective method to address the problem occured.

Regards

Sekhar

Former Member
0 Kudos

Hi,

This is the connectivity problem between ABAP stack and the mapping runtime which is a part of the java stack..

As mapping gets executed in the mapping runtime of java stack..connection needs to be established between abap stack and java stack which will happen through AI_RUNTIME_JCOSERVER rfc destination...

test this connection ...if failure then need to restart the java stack as suggested above...

HTH

Rajesh

Former Member
0 Kudos

Hi ALL,

Thanks for your valuable inputs.

I will ask Basis to test the connection if it fails and i will ask them to restart the server.

Once they are done i will get back to you.

Thanks,

Swetha

Former Member
0 Kudos

Hi Rajesh/All,

My problem is solved for the above Error.

But while testing i am facing the Java Mapping Error.

Below is Error log from MONI.

**********************************************************************************

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">LINKAGE_ERROR</SAP:Code>

<SAP:P1>geseaco_java_codeco_mappings/com/geseaco/sap/xi/m~</SAP:P1>

<SAP:P2>hhp://geseaco.com/XI/EDI/Emails</SAP:P2>

<SAP:P3>4205f2e1-2e02-11db-a9bf-f3a9ac10127f</SAP:P3>

<SAP:P4>-1</SAP:P4>

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>Incompatible class versions (linkage error)</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

*****************************************************

Here i am sending Java code. In some places i put as XXX and YYYY and sssss and _ - - - - - - - for confidential.

/*

  • Created on 24-Nov-2009

*

te email accordingly (so customers don't get emails from DEV/Test)

*/

package com.geseaco.sap.xi.mappings;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

import com.sap.aii.mapping.api.StreamTransformationException;

/**

  • @author Swetha

*

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

  • Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments

*/

public class xxxxEmailMapping extends yyyyyMapping {

public static void main(String[] args) {

try {

File inputDir =

new File("D:
ProjectFiles
SAP
TestData
sssss
In");

if (inputDir.isDirectory()) {

File[] files = inputDir.listFiles();

for (int i = 0; i < files.length; i++) {

InputStream in = new FileInputStream(files<i>);

xxxxxEmailMapping mapping = new xxxxxEmailMapping();

mapping.execute(

in,

new FileOutputStream(

"D:
ProjectFiles
SAP
TestData
sssss
Out
out"

+ i

+ ".xml"));

}

}

} catch (StreamTransformationException e) {

System.out.println(e.toString());

} catch (IOException e) {

System.out.println(e.toString());

}

}

public void execute(InputStream in, OutputStream out)

throws StreamTransformationException {

// TODO Auto-generated method stub

// Identify the environment

String systemID = "";

systemID = System.getProperty("SAPSYSTEMNAME");

String mailSubject = "Off Hire Report";

if (!"X46".equals(systemID)) {

mailSubject += " [sent from non-production environment "

+ systemID

+ "]";

}

String mailReceiver =

mail address will be here &gt;";

if ("X46".equals(systemID)) {

mailReceiver = mail address will be here ";

} else if ("X44I".equals(systemID)) {

mailReceiver = mail address will be here ";

} else if ("X42".equals(systemID)) {

mailReceiver = mail address will be here ";

} else if ("X40I".equals(systemID)) {

mailReceiver = mail address will be here ;

}

String mailSender =

"\mail address will be here &gt;";

String attachmentName = "Outgoing EDI.edi";

String boundary = "--AaZz";

String mailContent =

"Note: This is an automated e-mail. In the event of problems or queries, please contact the -


Support Centre: \r\n\r\n Tel: +------r\mail address will be here ";

String CRLF = "\r\n";

try {

// create XML structure of mail package

String output =

"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"

+ "<ns:Mail xmlns:ns=\"http://sap.com/xi/XI/Mail/30\">"

+ "<Subject>"

+ mailSubject

+ "</Subject>"

+ "<From>"

+ mailSender

+ "</From>"

+ "<To>"

+ mailReceiver

+ "</To>"

+ "<Content_Type>multipart/mixed; boundary=\""

+ boundary

+ "\"</Content_Type>"

+ "<Content>";

out.write(output.getBytes());

// create the declaration of the MIME parts

//First part

output =

"--"

+ boundary

+ CRLF

+ "Content-Type: text/plain; charset=UTF-8"

+ CRLF

+ "Content-Disposition: inline"

+ CRLF

+ CRLF

+ mailContent

+ CRLF

//Second part

+"--"

+ boundary

+ CRLF

+ "Content-Type: text/plain; "

+ "name="

+ attachmentName

+ CRLF

+ "Content-Disposition: attachment; filename="

+ attachmentName

+ CRLF

+ CRLF;

out.write(output.getBytes());

//Source is taken as attachment

copySource(in, out);

out.write("</Content></ns:Mail>".getBytes());

} catch (IOException e) {

throw new StreamTransformationException(e.getMessage());

}

}

protected static void copySource(InputStream in, OutputStream out)

throws IOException {

byte[] bbuf = new byte[in.available()];

int bblen = in.read(bbuf);

String ediString = new String(bbuf);

// Replace any existing line breaks/carriage returns

ediString = ediString.replaceAll("

n", "");

ediString = ediString.replaceAll("

r", "");

ediString = ediString.replaceAll("'", "'\r\n");

if (ediString.endsWith("\r\n")) {

ediString = ediString.substring(0, (ediString.length() - 2));

}

if (!(bblen < 0)) {

// replace all control characters with escape sequences

ediString = ediString.replaceAll("&", "&amp;");

ediString = ediString.replaceAll("\"", "&quot;");

ediString = ediString.replaceAll("'", "&apos;");

ediString = ediString.replaceAll("<", "&lt;");

ediString = ediString.replaceAll(">", "&gt;");

out.write(ediString.getBytes());

}

}

}

Please suggest where i am wrong.

And also i am not getting what is the linkage error :: incompatable class versions.

Please suggest

Thanks

Swetha

Former Member
0 Kudos

Can any one please suggest for my interface error.

Thanks,

Swetha

Former Member
0 Kudos

my question is answered.

Thanks all.

Swetha.

Former Member
0 Kudos

Hi ,

Contact your basis team and ask them to RESTART the java engine.

Regards,

Jude