In case of heavy load, receiving error message - CaughtExceptionType: javax.xml.transform.TransformerException, CaughtExceptionMessage: Unexpected EOF in prolog

Solution Unverified - Updated -

Issue

  • In case of heavy payload, request is not processed and when exchange is converted to string it is empty.
  • Code snippet
CachedOutputStream csnew = (CachedOutputStream)  message.getContent(OutputStream.class);
csnew.flush();
InputStream inputStream = csnew.getInputStream();
byte[] streamBytes = IOUtils.readBytesFromStream(inputStream);
inputStream.close();
String soapMessage = new String(streamBytes, "UTF8");
LOGGER.info("Soap message : "+ soapMessage);
soapMessage = soapMessage.replace("&", "&");
LOGGER.info("Message after handling  : "+ soapMessage);
InputStream stream2 = new ByteArrayInputStream(soapMessage.getBytes(StandardCharsets.UTF_8));
IOUtils.copy(stream2, os);
stream2.close();
os.flush();
message.setContent(OutputStream.class, os);
  • Error Logs
, CaughtExceptionType: javax.xml.transform.TransformerException, CaughtExceptionMessage: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0], StackTrace: ; Line#: 1
javax.xml.transform.TransformerException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
        at org.apache.xalan.transformer.TransformerImpl.fatalError(TransformerImpl.java:780)

Environment

  • Red Hat JBoss Fuse
    • 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.