Skip to Content
avatar image
Former Member

Java Mapping

Hello,

I have implement a simple mapping between to IDOC-Types in JAVA. As first I would test the mapping therefore I read the InputStream from a testfile, but this did not work. Can anybody help me?

Source code:

SAXBuilder parser = new SAXBuilder();

Document src_doc = parser.build(new FileInputStream("CRMXIF_ORDER_SAVE_TEMPLATE.xml"));

The parser.build statement makes the error:

java.lang.NoClassDefFoundError: com/sap/guid/GUIDFormatException

at com.sap.aii.utilxi.log.impl.LoggerImpl.log(LoggerImpl.java:168)

at com.sap.aii.utilxi.log.api.Logger.log(Logger.java:138)

at com.sap.aii.utilxi.prop.api.PropertySourceFactory.getPropertySource(PropertySourceFactory.java:56)

at com.sap.aii.utilxi.misc.api.AIIProperties.sync(AIIProperties.java:519)

at com.sap.aii.utilxi.misc.api.AIIProperties.(AIIProperties.java:292)

at com.sap.aii.utilxi.misc.api.AIIProperties.getInstance(AIIProperties.java:319)

at com.sap.aii.utilxi.xml.api.XMLServices.getParserFactory(XMLServices.java:144)

at com.sap.aii.utilxi.xml.xdom.io.XDOMInputter.parse(XDOMInputter.java:203)

at com.sap.aii.utilxi.xml.xdom.io.XDOMInputter.read(XDOMInputter.java:166)

at com.sap.aii.utilxi.xml.jdom.SAXBuilder.build(SAXBuilder.java:60)

at XIMapping.Map2Orders.main(Map2Orders.java:54)

Exception in thread "main"

Thanks for help

Björn

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Jun 21, 2004 at 11:25 AM

    Hi!!!

    Are you testing your java mapping after adding it to the Repository or outside it (from command line)?

    If you are doing it outside then have you got aii_util_misc.jar(there is GUIDFormatException class) file in your CLASSPATH?

    To test java mapping from command line you have to have aii_map_api.jar file in your CLASSPATH.

    If you want to test your java mapping, I would recommend you to use code like this below (look at the main function) rather than your source code.

    public class YOURMAPPING implements StreamTransformation {

    private Map m_param;

    public void setParameter(Map param) {

    m_param = param;

    }

    public void execute(InputStream in, OutputStream out) {

    // write your logic here

    // for example parsing input stream

    DefaultHandler handler = this;

    SAXParserFactory factory = SAXParserFactory.newInstance();

    try {

    SAXParser saxParser = factory.newSAXParser();

    this.out = out;

    saxParser.parse(in, handler);

    } catch (Throwable t) {

    t.printStackTrace();

    }

    }

    (...)

    public static void main(String args[]) throws Exception {

    System.out.println("Start");

    YOURMAPPING mapping = new YOURMAPPING();

    mapping.setParameter(new Hashtable());

    mapping.execute(new FileInputStream("CRMXIF_ORDER_SAVE_TEMPLATE.xml"), new FileOutputStream("output.xml"));

    System.out.println("Done.");

    }

    }

    Regards,

    Andrzej Filusz

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Björn,

      I don´t understand really good the concept of mapping test. When you test a mapping refers to test only the XML structures and corelations?, or with proxys you are able in the Integration repository to test this mapping connecting with the involved systems in the interface?.

      In this case what is the best place to test an interface in XI, in BC you can test in every moment any step of the scenario and you have one tool to make all, but in XI i don´t see it clear.

      Sorry, I im stucked now, probably because i am new with this.

      Thanks a lot Björn, i will apreciate any comment or help.

      Enrique.