REST service in POST mode that accepts XML in the request body will results HTTP 413 (Request entity too large)

Problem Description

Sending a huge request to the Rest Service (endpoint URL) using the POST Method results in the following error:

org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper - HTTP 413 Request Entity Too Large
	at org.apache.cxf.jaxrs.utils.ExceptionUtils.toWebApplicationException(
	at org.apache.cxf.jaxrs.provider.SourceProvider.readFrom(
	at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(
	at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(
	at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(
	at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(
	at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(
	at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(
	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
	at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
	at org.eclipse.jetty.server.Server.handle(
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
	at org.eclipse.jetty.server.AbstractHttpConnection.content(
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
	at org.eclipse.jetty.http.HttpParser.parseNext(
	at org.eclipse.jetty.http.HttpParser.parseAvailable(
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
	at org.eclipse.jetty.util.thread.QueuedThreadPool$


Steps to Reproduce

  1. Import the attached Job and run it.
  2. After the Job is run successfully, the endpoint URL should be:

  3. Go to the Soap UI and create a new REST service, using the endpoint URL shown above.
  4. Open the attached XML file in Notepad, copy the content and send it in the soap UI as a request.






Root Cause

CXF does not accept very large XML payloads to prevent DoS attacks. This behavior can be configured by specifying the corresponding Java system properties. In this case, the number of child elements of /requestSendNumberRange/items is about 55,000, which is more than the 50,000 allowed by default.


For more information, see the following URL:



  1. Go to Studio > Open the Route.
  2. Go to Advanced settings > JVM settings, then select Use Specific JVM arguments.
  3. Add a new entry as shown below:

  4. Save the Job and run it. It should be able to process the XML file and display:

Version history
Revision #:
8 of 8
Last update:
‎04-04-2019 03:07 AM
Updated by: