Skip to Content
0
Mar 01, 2010 at 11:54 AM

SAX Transformation

224 Views

Hi,

I have a problem with creating a SAX Parser on the PI 7.1 server. I get the following error in the log when I test the code in the repository and in the message flow.

com.sap.aii.ib.server.mapping.execution.jaxpfactories.MappingTransformerFactory:sap.com/com.sap.xi.repository[AT]com.sap.engine.boot.loader.ResourceMultiParentClassLoader[AT]42c4e790[AT]alive incompatible with class javax.xml.transform.sax.SAXTransformerFactory:null

[AT]= @

When I run the code on my local computer I dont get any problems. Does anybody know how I set up a SAX parser.

I currently use the following code.

	public void execute(InputStream is, OutputStream out)
	throws StreamTransformationException {
		try{
	     	//setup output handler
			 SAXTransformerFactory factory = 
				    (SAXTransformerFactory) SAXTransformerFactory.newInstance();
			 
		   th = factory.newTransformerHandler();
		   Result r = new StreamResult(out);
		   
		   th.setResult(r);
			// create parser
			DefaultHandler handler = this;
			SAXParserFactory parserFactory = SAXParserFactory.newInstance();
		
			SAXParser saxParser = parserFactory.newSAXParser();
			
			saxParser.parse(is, handler);
		}catch(Exception e){
			trace.addWarning(e.toString());
		}
	}

Best regards

Daniel Graversen.

[Figaf|http://figaf.com]