Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

J2EE engine killed by a Java-Mapping-program (XI SP16)


we have created a Java-Mapping prgram which has the task to validate incoming documents using a schema.

When we test this program, there would be thrown an exception, if the document is not valid. But if the document is valid the program kills the J2EE engine completley. All the services are stopped.

Does anybody know, why this happens?

We used the Blog "Validating messages in XI using XML-Schema" as template for our program.

Here our mapping class:

public class DocumentValidation implements StreamTransformation 
   static final String JAXP_SCHEMA_LANGUAGE =
   static final String W3C_XML_SCHEMA =
   static final String JAXP_SCHEMA_SOURCE =
   private Map            param = null;
   private AbstractTrace  trace = null;

   public void setParameter (Map param) 
	  this.param = param;
	  if (param == null) 
		 this.param = new HashMap();

   public void execute(InputStream in, OutputStream out) 
		 trace = (AbstractTrace)param.get(
						   StreamTransformationConstants.MAPPING_TRACE );
	     String messageID = (String)param.get(
		 trace.addInfo("Validating document with MessageID " + messageID + " ..."); 

	  	 DocumentValidation dv = new DocumentValidation();		 
		 InputStream schema = null;
		 String schemaName = new String("orders02.xsd");
		 schema = dv.getClass().getClassLoader().getResourceAsStream(schemaName); 
		 SAXParserFactory spf = SAXParserFactory.newInstance();
		 SAXParser sp = spf.newSAXParser();
		 sp.setProperty(JAXP_SCHEMA_SOURCE, schema);
		 sp.parse(in, new ParseErrorHandler());
		 // InputStream nach OutputStream kopieren
		 int readcount;
		 byte[] buffer = new byte[1024];
		 while ( (readcount = > -1) 
		 	out.write(buffer, 0, readcount); 
		 trace.addInfo("Stream was copied ... ");
	  catch(Exception ex)
	  	throw new RuntimeException("Error in Validation: " + ex);


final class ParseErrorHandler extends DefaultHandler
	public void error(SAXParseException ex) throws SAXException
		throw ex;

I hope anybody can help us.



Former Member

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question