Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Java Map

Hello,

I m using this JAVA MAp

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

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

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

import java.util.Map;

import java.io.*;

public class PayloadToXMLField implements StreamTransformation {

String strXML = new String();

//Declare the XML tag for your XML message

String StartXMLTag = "<Payload>";

String EndXMLTag = "</Payload>";

AbstractTrace trace;

private Map param = null;

public void setParameter(Map param) {

this.param = param;

}

public void execute(InputStream in, OutputStream out) {

trace =

(AbstractTrace) param.get(

StreamTransformationConstants.MAPPING_TRACE);

trace.addInfo("Process Started");

try {

StringBuffer strbuffer = new StringBuffer();

byte[] b = new byte[4096];

for (int n;(n = in.read(b)) != -1;) {

strbuffer.append(new String(b, 0, n));

}

strXML = strbuffer.toString();

} catch (Exception e) {

System.out.println("Exception Occurred");

}

outputPayload =

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

+ StartXMLTag

+ strXML

+ EndXMLTag;

try {

out.write(outputPayload.getBytes());

trace.addInfo("Process Completed");;

} catch (Exception e) {

trace.addInfo("Process Terminated: Error in writing out payload");;

}

}

}

Now when I m sending the file I m geeting the error

MAPPING">LINKAGE_ERROR

Incompatible class versions (linkage error)

I have compile this map using JDK1.6 and 1.4 both

Former Member
Not what you were looking for? View more on this topic or Ask a question