on 03-14-2007 7:08 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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,
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;
}
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..
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
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.