cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Maps with Java enhancements - JCO_SYSTEM_FAILURE

Former Member
0 Kudos

Hi,

I have reviewed several postings regarding XSLT Maps with Java enhancements. I followed instructions and build a jar file and the XSLT document. I built one imported archive with the .jar and .xsl. For the class, The path get loaded properly.

However, I still have a problem when and execute the interface.

My xslt has the following information

<xsl:transform version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:ns="http://xyz.abc.sap.def.com"

xmlns:javamap="java:xyz.Date_Time">

<xsl:param name="inputparam" />

<xsl:template match="/">

....

<test><xsl:value-of select="javamap:getDateValue($inputparam)"/></test>

....

</xsl:template>

</xsl:transform>

In SXMB_Moni I get the following error...

<?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>Exception in method processFunction.</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>"SYSTEM FAILURE" during JCo call. Exception in method processFunction.</SAP:Stack>

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

</SAP:Error>

If i remove the line

<test><xsl:value-of select="javamap:getDateValue($inputparam)"/></test>

The map ends successfuly.

Comments would be appreciated.

Regards,

Sergio

Accepted Solutions (0)

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

Have you uploaded the jar with your class xyz.Date_Time correctly to the Integration Repository as imported archive?

Is the spelling correct for the class name and the method?

Stefan

Former Member
0 Kudos

Stefan,

Thanks for your response.

I uploaded one jar file that has the class and the xsl file In the integration repository. I can see the path where the class is located. Find below the details. Let me know if you have any other ideas.

xmlns:javamap="java:xyz.Date_Time">

<xsl:if test="function-available('javamap:getDateValue')">

<test>it worked</test>

</xsl:if>

Java:

package xyz;

import java.util.Map;

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

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

import java.util.*;

import java.text.*;

public class Date_Time

Thanks,

Sergio

stefan_grube
Active Contributor
0 Kudos

Is the method static? Does it return a String value?

Former Member
0 Kudos

Stefan,

Find the class and method definition below. The method is static and it returns the string.

==========

package xyz;

import java.util.Map;

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

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

import java.util.*;

import java.text.*;

public class Date_Time {

private static AbstractTrace trace = null;

public static String getDateValue(Map inputparam)

{

trace = (AbstractTrace)inputparam.get(

StreamTransformationConstants.MAPPING_TRACE );

Date now1 = new Date();

SimpleDateFormat formatter = new SimpleDateFormat ("yyyyMMd");

String dateString = formatter.format(now1);

return dateString;

}

stefan_grube
Active Contributor
0 Kudos

From your description, I cannot see any error. Everything looks fine..

Regards

Stefan

Former Member
0 Kudos

Hi Sergio,

it seems I have exactly the same problem. Did you find a solution for this problem?

Mathias

holger_stumm2
Active Contributor
0 Kudos

Hi,

we had some problems with static java class functions in XSLT files.

They work fine if they are executed exactly once. When they are hit a second time in the XSLT, they are throwing errors. In our case, after redesigning RFC lookup classes, they work when they are "re-entrant", i.e. when tey are not static. I am about to prepare a blog together with your java developer, but time runs too fast..