on 12-12-2013 10:44 AM
Using a Java mapping to receive EDI file and sent to different location based on the content in the file. When I tried to run from the end to end received the below error
<SAP:Code area="RCVR_DETERMINATION">CX_RD_PLSRV</SAP:Code>
<SAP:P1>Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed</SAP:P1>
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText />
<SAP:Stack>Error when determining the receiver: Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed Error while determining root tag of XML: BOM / charset detection failed Error while parsing an XML stream: 'BOM / charset detection failed'.</SAP:Stack>
If I run in Operation Mapping
LinkageError when loading class UpmFileIdentification/bin/fileidentification; details: java.lang.NoClassDefFoundErro
Appreciate your inputs and quick response.
Thanks,
Senthil
Hi All,
I could able to nail-down the issue and it is because of source EDI file. When I process the attached Sample2 file the interface executed successfully,
So now is it possible to validate EDI file content in File to File scenario without mapping? Kindly advice.
Note: Sample is original file and Sample2 is modified file
Thanks,
Senthilkumar
Message was edited by: Senthil Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks for the input! The actual problem Linkage had been resolved but the second error still not resolved hence I close this thread and opened a new thread of new problem.
http://scn.sap.com/thread/3472460
Thanks,
Senthil.
Hi Senthil,
It seems you have not compiled the java code incorrect java version. For Pi 7.1 you need j2sdk 1.5. Secondly if you are using external library to compile the code, then those libraries should be uploaded along with the original java class. Please kindly recompile and upload again.
Second reason can be
If your XML is UTF-16 or UTF-32,then it needs a BOM which is missing. Please check this link.
http://en.wikipedia.org/wiki/Byte-order_mark
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit, Anumpam,
Thanks for the useful info! Could able to clear the linkage error but still when I execute end-to-end getting the below error
<SAP:Stack>Error when determining the receiver: Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed Error while determining root tag of XML: BOM / charset detection failed Error while parsing an XML stream: 'BOM / charset detection failed'.</SAP:Stack>
Note: I guess the RAW file will not get covert into XML and which will be directly read by Java code. Correct me if I am wrong
Snippet of my input fie:
UNB+UNOC:2+XXX:ZZZ+003708183569+131202:1657+XXX0000000010' -> start of the file
UNZ+1+XXX0000000010' -> end of the file
My code to chose the folder based on the content as below:
package sap.com;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Map;
import com.sap.aii.mapping.api.AbstractTrace;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
public class fileidentification extends AbstractTransformation
{
private Map map = null;
private AbstractTrace trace = null;
String line =null;
StringBuffer message=new StringBuffer();
public static void main(String[] args) throws Exception
{
// TODO Auto-generated method stub
fileidentification file=new fileidentification();
FileInputStream in=new FileInputStream("C:/Users/Test/DESADV.txt");
FileOutputStream out=new FileOutputStream("C:/Users//Test/output.txt");
file.execute(in,out);
//out.write(file.message.toString().getBytes("UTF-8"));
}
public void execute(InputStream in, OutputStream out)
throws StreamTransformationException
{
Boolean SYSTEMIN=false;
Boolean DESADV=false;
Boolean EXWL12=false;
Boolean EXUI13=false;
Boolean LOC= false;
// TODO Auto-generated method stub
trace = (AbstractTrace)map.get( StreamTransformationConstants.MAPPING_TRACE );
trace.addInfo("EXECUTE METHOD STARTS- STEP -1");
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(in,""));
trace.addInfo("BUFFER READER STARTS - STEP 2");
message.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?> <ns0:Receivers xmlns:ns0=\"http://sap.com/xi/XI/System\">");
message.append(" <Receiver> <Party agency=\"\" scheme=\"\"/><Service>");
trace.addInfo("ROOTS ARE APPDEDED IN MESSAGE -STEP -3 ");
while ((line = reader.readLine()) != null)
{
trace.addInfo("WHILE LOOP STARTS -STEP 4 ");
if(line.indexOf("IFTMBF")>0)
{
SYSTEMIN=true;
break;
}
if(line.indexOf("DESADV")>0)
DESADV=true;
if(line.indexOf("EXWL12")>0)
EXWL12=true;
if(line.indexOf("EXUI13")>0)
EXUI13=true;
if(line.indexOf("LOC+8+LO01")>0)
LOC=true;
}
trace.addInfo("WHILE LOOP ENDS -STEP 5 ");
if(SYSTEMIN)
message.append("SYSTEMIN");
else if(DESADV&&EXWL12&&LOC)
message.append("ITSSYSTEMVALKOXW");
else if(DESADV&&EXUI13&&LOC)
message.append("ITSSYSTEMVALKOXU");
else if(DESADV)
message.append("ITSSYSTEMCSLXW");
message.append(" </Service> </Receiver></ns0:Receivers>");
out.write(message.toString().getBytes(""));
trace.addInfo("AFTER OUT HAS WRITTENS -STEP 6 ");
}catch (Exception e)
{
}
System.out.println(message);
}
public void setParameter(Map param) {
// TODO Auto-generated method stub
this.map = param;
}
@Override
public void transform(TransformationInput arg0, TransformationOutput arg1)
throws StreamTransformationException {
this.execute(arg0.getInputPayload().getInputStream(),arg1.getOutputPayload().getOutputStream());
}
}
Appreciate your further inputs!
Regards,
Senthil
Message was edited by: Senthil Kumar
Hi Anupam,
Sorry for the delay! when tested in eclipse the code is working fine and also working fine from Operating Mapping where the target node had been populated with the receiver value based on the input file.
I guess there is an issue with below set of code
message.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "\n" ); | ||
message.append("<ns0:Receivers xmlns:ns0=\"http://sap.com/xi/XI/System\">" + "\n"); | ||
message.append(" <Receiver>" + "\n"); | ||
message.append("<Party agency=\"\" scheme=\"\"/>"+"\n" ); | ||
message.append("<Service>"); |
The entire code had been given in the attachment with the sample file. Appreciate your input as it is becoming a bottle-neck for the interface. And when I do test configuration for ID I am getting the same error given in snippet.
Thanks,
Senthil.
HI
Check your message mapping first and check is there any error?
Regards,
Manigandan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.