on 06-21-2004 10:23 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrzej,
I'm testing it outside in Eclipse with the XI3.0 libs. I have added the aii_util_misc.jar, aii_map_api.jar, aii_util.log.jar, aii_util_xml.jar, aii_utilxi_misc.jar, inqmyxml.jar.
Following causes an error:
DefaultHandler handler = this;
And which SAXParser do you use?
javax.xml.parsers.SAXParser or com.inqmy.lib.xml.parser.SAXParser
Regards
Björn
Hello Enrique,
I can only tell you the way in XI 3.0. I don't know, if this is the same way in XI2.0.
At Interface-Mapping is a Tab-Page 'TEST' where you can upload a sample document
you are able to upload a sample document (load xml-instanz) and then you can execute the mapping with this file.
I hope this can help you.
Regards
Björn
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.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.