Error using Java Mapping

Hi All,
I am working on scenario with help of this blog for java mapping
http://www.riyaz.net/blog/xipi-java-mapping-demystified/
I am getting error while i test the interface mapping as
Problem while building Tree view
Unable to display tree view; Error when parsing an XML document (Premature end of file.)
How can i solve this error
Regards,
Syed

Hi,
all you need to do is close all the tags properly and try to validate the XML
hope it will work
Regards
Venkat

Similar Messages

  • N:1 Mapping Possible using Java Mapping?

    All,
    Is it possible to do a N:1 mapping using Java Mapping?
    If yes , how?
    Reason for this question is that the execute() of the Java Mapping is going to take the source / request message as the InputStream . In the case of N:1 mapping , as we have multiple messages , how will they be send to the InputStream? Will both the messages be sent combined into the InputStream? Will the MESSAGES tag be embedded into the input stream?
    Regards,
    Bhavesh

    Hi @ll;
    i try the same.
    to conduct a java mapping with 2 input structures that fills one target structure.
    This mapping is part of a Integrationprocess.
    I tested the mapping at the Integration Repository (Interface mapping) with the structure given by henrique and it works fine without any error.
    At runtime this structure looks like this (different prefix)
    <?xml version="1.0" encoding="UTF-8"?>
    <sxi:Messages xmlns:sxi="http://sap.com/xi/XI/SplitAndMerge">
         <sxi:Message1>
              <YOURXML1>...</YOURXML1>
         </sxi:Message1>
         <sxi:Message2>
              <YOURXML2>...</YOURXML2>
         </sxi:Message2>
    </sxi:Messages>
    As I put it in the Integrationprocess unfortunately a strange error arises.
    The trace Workflow-Protocoll shows following error.
    <Trace level="2" type="T">Call method execute of the application Java mapping com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
    <Trace level="2" type="T">Java mapping com/endress/infoserve/xi/mapping/MergeConfigStore_IdocOrder completed. (executeStep() of com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
    <Trace level="1" type="T">Parsing error after multi mapping.Expected Message<i> instead of IDOC </Trace>
    I can't make head nor tail of it.
    what´s the mistake?
    can anybody please help me?
    Thanks in advance
    Kind regards

  • Getting Error in java mapping: Parsing empty source. Root element expected!

    Hi Experts,
       I am using java mapping for schema validation of input message. I have followed all the standard procedures and implemented the java class in the interface mapping.
    My interface mapping is like this:
    OrderData --->Java Class ---SchemaValidate
                         Mesg Map ---OrderData_to_BAP --->BAPI Msg
    So first I want to validate the schema of the input message. If the input message is invalid then XI should throw an exception. Then I use the actual message mapping to map the input order data to the BAPI input parameters.
    In the java code I am using xerces parser.
    The java code works fine when I run it as a standalone application.
    The interface mapping also works fine if I don't include the java mapping. Ofcourse schema validation does not happen.
    But when I test the interface mapping by including the java mapping then I am getting the error:
    Call method execute of the application Java mapping SchemaValidate
    Java mapping SchemaValidate completed. (execute() of SchemaValidate
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Parsing an empty source. Root element expected!
    What am I doing wrong? Why it is not getting the root element?
    My Java code is as follows:
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import java.io.*;
    import java.util.Map;
    import javax.xml.parsers.*;
    import org.xml.sax.helpers.*;
    import org.xml.sax.*;
    import org.apache.xerces.jaxp.*;
    Sample mapper for SAP-XI
    @author Gopal
    public class SchemaValidate implements StreamTransformation {
        //Constants when using XML Schema for SAX parsing.
         static final String JAXP_SCHEMA_LANGUAGE =
         "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
         static final String W3C_XML_SCHEMA =
         "http://www.w3.org/2001/XMLSchema";
         static final String JAXP_SCHEMA_SOURCE =
         "http://java.sun.com/xml/jaxp/properties/schemaSource";
    Injection of mapping parameters
    from integration engine
    @param map Map with configuration data
        public void setParameter(Map map) {
    Mapping implementation
    @param inputStream Input data from integration engine
    @param outputStream Output data to integration engine
        public void execute(InputStream inputStream,
                            OutputStream outputStream)
          throws StreamTransformationException {
            try {
                  // obtain an object of class javax.xml.parsers.SAXParser,
                  SAXParserFactory spf = SAXParserFactoryImpl.newInstance();
                  spf.setNamespaceAware(true);
                  spf.setValidating(true);
                  SAXParser sp = spf.newSAXParser();
                  // setup the schema file
                  sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                  sp.setProperty(JAXP_SCHEMA_SOURCE, new File("IOReqMsgSchema.xsd"));
                  //parse the input xml using the given schema
                  sp.parse(inputStream, new ParseErrorHandler());
            catch(SAXException se) {
              se.printStackTrace();
            catch ( Exception e ) {
              throw new StreamTransformationException( e.getMessage() );
    My input message is :
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderCreate_request xmlns:ns0="mynamespace">
       <ORDER>HTEST1234567</ORDER>
       <ORDER_TYPE>z001</ORDER_TYPE>
       <ORDER_NAME>Test Order</ORDER_NAME>
       <CO_AREA>INTC</CO_AREA>
       <CCTR_POSTED>1234567890888888888</CCTR_POSTED>
       <CURRENCY>USD</CURRENCY>
       <PERSON_RESP>12345679</PERSON_RESP>
    </ns0:OrderCreate_request>
    Kindly help! please this is urgent!!!!!!
    Thanks
    Gopal
    Edited by: gopalkrishna baliga on Feb 28, 2008 9:34 AM

    Hi Stefan,
       I did the code changes to return output stream and the java code works perfectly in standalone mode in my PC.
       But when I use the same in the Java mapping with XI then It throws an error "Getting Error in java mapping: Parsing empty source. Root element expected!".
    My XI J2EE server has JDK1.4.3.11.
    Is there any limitation of using SAX parser in XI? If Yes, then which parser should be used for schema validation in XI?
    I have included the XSD file for schema validation along with class files in the .jar file. This jar file is then imported in XI repository. Is the XI engine not able to read the XSD file?
    Do I have to handle reading XSD file differently? Any suggession how?
    Is this parser error due to some security access?
    Kindly help me! I have been struggling with this problem since 2 weeks. I will be greatfull to you if you can help me.
    Thanks
    Gopal

  • Error in Java Mapping for Single XML conversion

    We are working on ABAP Proxy --> SAP PI 7.1 --> SOAP (Synchronous Scenario).
    (ECC -> PI -> Legacy CRM)
    Client has provided a WSDL with Single Node of XML and asking us to pass the whole structure as an single string along with all the nodes of data structure. To perform mapping we are using Java Mapping.
    Message which we are getting after Java Mapping:
    Input
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject">
       <ITEM>
          <sSlsOrderCode>1001</sSlsOrderCode>
          <sDlrCode>A250</sDlrCode>
          <sRejectReason>Z2</sRejectReason>
          <nCircleCode>2</nCircleCode>
       </ITEM>
    </ns0:MT_SOReject_Sender>
    Output
    <?xml version="1.0" encoding="UTF-8"?><MT_Trg xmlns:ns="urn:Test_File_to_File"><stringinp>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject"&gt;&lt;ITEM&gt;&lt;sSlsOrderCode&gt;1001&lt;/sSlsOrderCode&gt;&lt;sDlrCode&gt;A250&lt;/sDlrCode&gt;&lt;sRejectReason&gt;Insufficient Stock Balance&lt;/sRejectReason&gt;&lt;nCircleCode&gt;2&lt;/nCircleCode&gt;&lt;/ITEM&gt;&lt;/ns0:MT_SOReject_Sender&gt;</stringinp></MT_Trg>
    Is ther any way from which we can convert &gt; as u201C>u201D and &lt; as u201C<u201D.  Required result is as follows
    Required Output
    <?xml version="1.0" encoding="UTF-8"?><MT_Trg xmlns:ns="urn:Test_File_to_File"><stringinp><?xml version="1.0" encoding="UTF-8"?><ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject"><ITEM><sSlsOrderCode>1001</sSlsOrderCode><sDlrCode>A250</sDlrCode><sRejectReason>Insufficient Stock Balance</sRejectReason><nCircleCode>2</nCircleCode></ITEM></ns0:MT_SOReject_Sender></stringinp></MT_Trg>
    We are using following Java Code for the same.
    import java.io.BufferedReader;
              import java.io.FileInputStream;
              import java.io.FileOutputStream;
              import java.io.InputStream;
              import java.io.InputStreamReader;
              import java.io.OutputStream;
              import java.util.Map;
              import javax.xml.parsers.DocumentBuilder;
              import javax.xml.parsers.DocumentBuilderFactory;
              import javax.xml.transform.Transformer;
              import javax.xml.transform.TransformerFactory;
              import javax.xml.transform.dom.DOMSource;
              import javax.xml.transform.stream.StreamResult;
              import org.w3c.dom.Element;
              import org.w3c.dom.Document;
              import org.w3c.dom.Text;
              import com.sap.aii.mapping.api.*;
              import com.sap.aii.mapping.api.StreamTransformation;
    public class SingleStr implements StreamTransformation{
          * @author user
          * To change the template for this generated type comment go to
          * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
                    public static void main(String args[]) throws Exception {
                FileInputStream inFile =
                 new FileInputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Input.XML");
                FileOutputStream outFile =
                 new FileOutputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Output.XML");
                 SingleStr xml = new SingleStr();
                xml.execute(inFile, outFile);
                System.out.println("Success");
               public void setParameter(Map param) {
                Map map = param;
               public void execute(InputStream in, OutputStream out)
                throws com.sap.aii.mapping.api.StreamTransformationException {
                try {
                 //************************Code To Generate The XML Parsing Objects*****************************//    
                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 TransformerFactory tf = TransformerFactory.newInstance();
                 Transformer transform = tf.newTransformer();
                 //Document doc = db.parse(in);
                 Document docout = db.newDocument();
                 Element root = docout.createElement("MT_Trg");
                 root.setAttribute("xmlns:ns","urn:Test_File_to_File");
                 docout.appendChild(root);
                 Element stringinp = docout.createElement("stringinp");
                 root.appendChild(stringinp);
                 BufferedReader inpxml = new BufferedReader(new InputStreamReader(in));
                 StringBuffer buffer = new StringBuffer();
                 String line="";
                 while ((line = inpxml.readLine()) != null)
                 buffer.append(line);
                 String inptxml=buffer.toString();
                 Text srcxml = docout.createTextNode(inptxml);
                 stringinp.appendChild(srcxml);
                 DOMSource domS = new DOMSource(docout);
                 transform.transform((domS), new StreamResult(out));
                 } catch (Exception e) {
                   System.out.print("Problem parsing the file: " + e.getMessage());
                   e.printStackTrace();
    Please help!!

    We are using following Java Code for the same.
    import java.io.BufferedReader;
              import java.io.FileInputStream;
              import java.io.FileOutputStream;
              import java.io.InputStream;
              import java.io.InputStreamReader;
              import java.io.OutputStream;
              import java.util.Map;
              import javax.xml.parsers.DocumentBuilder;
              import javax.xml.parsers.DocumentBuilderFactory;
              import javax.xml.transform.Transformer;
              import javax.xml.transform.TransformerFactory;
              import javax.xml.transform.dom.DOMSource;
              import javax.xml.transform.stream.StreamResult;
              import org.w3c.dom.Element;
              import org.w3c.dom.Document;
              import org.w3c.dom.Text;
              import com.sap.aii.mapping.api.*;
              import com.sap.aii.mapping.api.StreamTransformation;
    public class SingleStr implements StreamTransformation{
               public static void main(String args[]) throws Exception {
                FileInputStream inFile =
                 new FileInputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Input.XML");
                FileOutputStream outFile =
                 new FileOutputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Output.XML");
                 SingleStr xml = new SingleStr();
                xml.execute(inFile, outFile);
                System.out.println("Success");
               public void setParameter(Map param) {
                Map map = param;
               public void execute(InputStream in, OutputStream out)
                throws com.sap.aii.mapping.api.StreamTransformationException {
                try {
                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 TransformerFactory tf = TransformerFactory.newInstance();
                 Transformer transform = tf.newTransformer();
                 //Document doc = db.parse(in);
                 Document docout = db.newDocument();
                 Element root = docout.createElement("MT_Trg");
                 root.setAttribute("xmlns:ns","urn:Test_File_to_File");
                 docout.appendChild(root);
                 Element stringinp = docout.createElement("stringinp");
                 root.appendChild(stringinp);
                 BufferedReader inpxml = new BufferedReader(new InputStreamReader(in));
                 StringBuffer buffer = new StringBuffer();
                 String line="";
                 while ((line = inpxml.readLine()) != null)
                 buffer.append(line);
                 String inptxml=buffer.toString();
                 Text srcxml = docout.createTextNode(inptxml);
                 stringinp.appendChild(srcxml);
                 DOMSource domS = new DOMSource(docout);
                 transform.transform((domS), new StreamResult(out));
                 } catch (Exception e) {
                   System.out.print("Problem parsing the file: " + e.getMessage());
                   e.printStackTrace();
    Please help!!

  • 1:n Transformation using JAVA Mapping Scenario

    Hi Frnds,
    I done a scenario using 1:n Transformation Scenario using XSLT,Graphical Mapping.
    But i want to develop scenario Using JAVA Mapping.
    Can anybody done the same scenario using JAVA Mapping share the links..
    Regards,
    Raj Sekhar

    You can use SAX parser for this
    firstly create a StringBuffer sb object which will store our target output
    when startDocument() gets called append the xml declaration in this method
    sb.append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
    sb.append("<Root>");
    next for the Test element you have your startElement() method called which will contain the name of your source tag i.e Test
    for this , you will need to set a variable boolean isTest to true which was initialised as a false value.
    in the characters method you will get the value present in this tag.
    test the variable isTest for true value.
    if it is true then append the following
    sb.append("<Test1>"name"</Test1>"); //name is the buffer passed in characters method
    sb.append("<Test2>"name"</Test2>");
    sb.append("<Test3>"name"</Test3>");
    at the end your endelement() will be called
    here reset the value of isTest to false.
    in your endDocument()
    sb.append("</Root>");
    lastly convert to byte[] and then to outputStream format
    Edited by: Progirl Progirl on Jul 4, 2008 2:00 PM

  • RFC Lookup using Java Mapping program - Examples

    Dear Experts,
    I am working on a scenario which is using 1:N mapping. For deciding the target message I have to use RFC Lookup to call the backend ERP system and there are 2 ERP systems involved in this integration. As I am using Java Mapping and never did a RFC Lookup in Java. I kindly request you to give me some examples which I could use for my RFC calls in my Java Mapping. Simple example will do.
    Client is adamant to use Java mapping, I could achieve this easily using XSLT or Graphical Mapping.
    Advance Thanks,
    Pradeep

    Hello,
    why don't you use Extended Receiver Determination Defining Extended (Dynamic) Receiver Determination - Integration Directory - SAP Library?
    What you can do is create a Message Mapping between your source message and Receivers message type. In this message mapping you can use your RFC to generate the target message.
    For example, lets say we have the function ZFM_GET_INTERFACE_INFO used to generate the List of Receivers given a source message. You could create a Message Mapping as below:
    In this case, the RFCLookup box look as below:
    The receiver determination configuration would look as follows:
    Afterwards, you will need two specific message mappings for the two ERP systems.
    Summarizing, you'll need:
    1.- A Message Mapping: Source Message to Receivers Message Type (This one uses the RFC Lookup)
    2.- A Message Mapping: Source Message to Target Message for ERP 1
    3.- A Message Mapping: Source Message to Target Message for ERP 2
    In Integration Directory you'll have 1 Receiver Determination(Source system, Target System determined Dynamically) and 2 Interface Determinations (Source System to ERP1, Source System to ERP2), etc.
    I hope you find it useful.
    Regards!

  • How TO Use Java Mapping In XI

    Hi Experts,
    please help me ,
    How TO Use Java Mapping In XI?
    Thanks
    Mahesh

    Hi,
    Just refer the following links for java mapping:-
    1./people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs
    2./people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
    Regards,
    Ashwin M
    Reward if helpful

  • XML Structure Conversion using JAVA Mapping

    Hi Experts,
    I am having a requirement in which i want to convert the contents of source xml structure into a string and map it to the target field.
    Source Structure:
    <SRC>
    <Node1>ABCD</Node>
    <Node2>XYZ</Node2>
    <Node3>1234</Node>
    </SRC>
    Target Structure:
    <TRG>
    <Node1>ABCDXYZ</Node1>
    </TRG>
    Both the source and target structures are in xml format only.....just the condition is that I have to use Java mapping to achieve it.
    The contents of Source node Node3 are not to be mapped.
    Since I have very less knowledge of Java it will be very helpful if you provide the complete code to me.
    Thanks,
    Abhishek.

    Hello Udo,
    Thank you for reply. It seems ABAP mapping is easier.
    What do you think about the idea of using Value Mapping for such conversion task? In this case is it obligatory to use Java coding? And how about performance - will it be better than in case of ABAP mapping, can you say?
    Thank you,
    Igor

  • Dynamic file name while using java mapping

    Hi All,
    i need help.
    I am using java mapping to convert xml file in zip file.
    Now i need to set output file name as SiteId_TimeStamp.zip.
    Site id is comping in xml file.
    How can i do this?
    I tried many thing but didnt get the solution..
    As their is no message mapping so I am unable to use ASMA.
    Please help.

    Did you check the wiki? You just need to add the code into you java mapping..
      Map mapParameters = (Map) transformationInput.getInputHeader().getAll();
       // a) Set Output File name
       mapParameters.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic",
                                                             StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
       DynamicConfiguration conf = (DynamicConfiguration) mapParameters.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
       DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
       //Depending on your requirement edit this logic. Here, NewDynamicName + CurrentDate will be output file name.
       DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
       conf.put(key, ("NewDynamicName_" + dateFormat.format(new Date())) + ".pdf");

  • Query on processing a PDF file using Java mapping

    Hi All,
    i am trying to process a XML and PDF file using Java mapping, it is successful in XML but unable to do for PDF.
    below is the code i am using... can any one guide me how to process PDF's..
    byte byte1 = 0;     
    java.io.ByteArrayOutputStream bos = (ByteArrayOutputStream)outputstream;
    while((byte1=(byte)inputstream.read())!=-1){
    bos.write(byte1);
    bos.close(); 
    Thank You,
    Madhav

    Hi Madhav,
    I think instead of going with JAVA mapping you can write a custom adapter module for it.
    Ref:  /people/sap.user72/blog/2005/07/31/xi-read-data-from-pdf-file-in-sender-adapter
    Also check : Re: PI 7.1 : Taking a input PDF file and mapping it to a hexBinary attribute
    /people/shabarish.vijayakumar/blog/2009/05/17/trouble-writing-out-a-pdf-in-xipi
    Thanks,
    Edited by: Hareenkumar on Dec 21, 2010 11:12 AM

  • Can any one please send me sample programs using java mapping..

    <b>Can any one please send me sample programs using java mapping with input and output?</b>
    please let me know how to get started with java mapping?
    Prerequisites for java mapping ?
    What are the jars need to be deployed for SAX,DOM.  And how to do it in NWDS?
    Use of Execute() and setparameter() ... StreamTransformation?
    Some sample program using java mapping with simple logic(input and output)?

    Hi,
    Did you go thro these blogs?
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    Nice blogs to start Java Mapping.
    Go thro this one too.
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • File to JDBC using JAVA Mapping

    Hello,
      Can u explain me about the above scenario of File to JDBC using JAVA Mapping.
       Iam new to XI explain above in detail.
    *Points will be Rewarded*
    Thanks&Regards,
    RavichandKone.

    HI,
    If your mapping is one to one then dont go for java mapping use graphical mapping.
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 --> for jdbc receiver: file -JDBC
    Here are the link which will help you in writing the stored procedure:
    Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    Stored Procedures-
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    http://www.ics.com/support/docs/dx/1.5/tut6.html
    /people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
    http://www.ics.com/support/docs/dx/1.5/tut6.html
    http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html
    http://www.sqlteam.com/article/stored-procedures-an-overview
    thnx
    Chirag Gohil

  • How to replace namespace tag with new value using -JAVA MAPPING

    Hi Guys,
    I need to replace namespace Tag in Target xml with a new value.
    For Eg: My namespace Tag is - <ns0:TestHeader xmlns:ns0="http://0020.TestHeader.SS.com">
    I want My target xml to have value- <ns0:TestHeader>
    How can i achieve it using JAVA mapping?
    Can you provide me the code to do so.

    Sarjana,
    Not well-formed XML is only possible by Java Mapping. Please use below replace logic in Java map.
    inputContent.replaceAll("<ns0:TestHeader xmlns:ns0=\"http://0020.TestHeader.SS.com\">", "<ns0:TestHeader>");
    Link1, Link2.

  • Error in Java mapping

    Hi~
    I am trying to use import statement :
    import com.sap.aii.mapping.api.StreamTransformation; in the java mapping.
    But I am getting an error saying
    "StreamTransformation cannot be resolved to a type"
    I am working on the SAP Netweaver STudio SP01. Do I need to load any libraries for the SAP programs ?
    I am a newbie with Java. I dont get the direction to resolve this issue.
    Good Day~
    ~Peeru

    Hi,
    guess Raj is right.
    This could be helpful too:
    /people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    Regards
    Patrick

  • Error in Java Mapping program

    Hi friends,
    I am tryin java mapping for first time.. and created one java program using link https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/wholePayloadtoaXML+field
    But when I am compiling it using JAVAC, I am getting following error message that
    package com.sap.aii.mapping.api does not exist . How can I solve this error.
    Complete error is as follows:
    C:j2sdk1.4.2_16-x64 in>javac PayloadToXMLField.java
    PayloadToXMLField.java:1: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.StreamTransformation;
                                   ^
    PayloadToXMLField.java:2: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.AbstractTrace;
                                   ^
    PayloadToXMLField.java:3: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.StreamTransformationConstants;
                                   ^
    PayloadToXMLField.java:8: cannot resolve symbol
    symbol  : class StreamTransformation
    location: class PayloadToXMLField
    public class PayloadToXMLField implements StreamTransformation {
                                              ^
    PayloadToXMLField.java:16: cannot resolve symbol
    symbol  : class AbstractTrace
    location: class PayloadToXMLField
        AbstractTrace trace;
        ^
    PayloadToXMLField.java:27: cannot resolve symbol
    symbol  : class AbstractTrace
    location: class PayloadToXMLField
                (AbstractTrace) param.get(
                 ^
    PayloadToXMLField.java:28: cannot resolve symbol
    symbol  : variable StreamTransformationConstants
    location: class PayloadToXMLField
                    StreamTransformationConstants.MAPPING_TRACE);
                    ^
    PayloadToXMLField.java:43: cannot resolve symbol
    symbol  : variable outputPayload
    location: class PayloadToXMLField
            outputPayload =
            ^
    PayloadToXMLField.java:50: cannot resolve symbol
    symbol  : variable outputPayload
    location: class PayloadToXMLField
                out.write(outputPayload.getBytes());
                          ^
    9 errors
    Thanks,
    Brijesh Soni

    thanks , it is done now..
    the program is compiled properly and class file is generated.
    but m gettin error in mapping.
    in IR i created two message type  with data type as string.
    and i had imported the class file and java program using Imported archives.
    now in interface mapping mapping program i had selected type as Java Class.and name of java program.
    but when i tested it, it is giving error as Linkage error occurred when loading class zip/PayloadToXMLField
    Please suggest, M i doing some thing wrong?is any thing missing?
    Program tht i had used in java
    from link (https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/wholePayloadtoaXML+field):
    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();
        String outputPayload = 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");;
    and detailed trace of error is:
    11:34:21 Start of test
    LinkageError at JavaMapping.load(): Could not load class: zip/PayloadToXMLField
    java.lang.NoClassDefFoundError: zip/PayloadToXMLField (wrong name: PayloadToXMLField) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.lang.ClassLoader.defineClass(ClassLoader.java:448) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingLoader.findClass(RepMappingLoader.java:175) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at com.sap.aii.ibrep.server.mapping.ibrun.RepJavaMapping.load(RepJavaMapping.java:136) at com.sap.aii.ibrep.server.mapping.ibrun.RepJavaMapping.execute(RepJavaMapping.java:50) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127) at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.transform(MapServiceRemoteObjectImpl0_0.java:167) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:104) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    11:34:21 End of test

Maybe you are looking for

  • How do you Set up a Family Pack sub-account

    how do you Set up a Family Pack sub-account i have purchased a Family Pack account and enter the activation key and i can not find where to set up the sub-account. please help Denis

  • New Customer Very Slow BB Speed

    Hi, Im looking for some help with my broadband speed, the technical help in India don't seem to be very knowledgeable. When signing to BT I asked what speeds I could hope to achieve, I was told between 5-8 which I was very happy about as iv just move

  • How can you create a jpeg from video in imovie 13?

    In imovie11 you could hit share, convert using quicktime, and then select mov to jpeg or gif.  that option is not available in imovie13?  Anyone know how to create a jpeg or gif in the new imovie?

  • Group texts are green should be blue...

    The last week or so, group texts to iPhones that I have been group texting for years are now green---OR some won't even go through! What is going on? Am I being charged for texts that SHOULD be blue?! I rebooted my phone, backed it up etc. By themsel

  • How do I create files in Captivate 6 and save them in a lower version?

    I have Captive 6 at home and at work we are using 5.5.with no plans to upgrade.  How do I create or edit in Captivate 6 and still save files so my coleagues can contribute using the software we are given at work?