camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg.Kasian" <>
Subject Problems when forwarding large post with jetty
Date Fri, 19 Oct 2012 07:24:53 GMT
I am facing the problem when forwarding post requests with large data using
camel-jetty component. I am not sure what is the reason, stack trace is:

2012-10-19 10:04:30.991:WARN:oejs.HttpConnection:header full:
java.lang.RuntimeException: Header>6144
2012-10-19 10:04:30.992:WARN:oejs.Response:Committed before 500 null
2012-10-19 10:04:30.992:WARN:oejs.HttpConnection:/forward
java.lang.IllegalStateException: Committed
	at org.eclipse.jetty.server.Response.resetBuffer(

camel version 2.10.0
jetty version 7.5.4.v20111024
The problem first occured when running camel based app on karaf 2.2.9,
however I can reproduce it with this unit test:

import java.util.Random;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.http.HttpStatus;
import org.junit.Test;

public class JettyPostBigDataTest extends CamelTestSupport {

    private static final int LENGTH = 5 * 1024;

    public void testPostParameter() throws Exception {
        final String body = generateBody(LENGTH);
        final NameValuePair[] data = {
            new NameValuePair("param", body)
        final HttpClient client = new HttpClient();
        final PostMethod post = new
        final InputStream response = post.getResponseBodyAsStream();
        final String out =
context.getTypeConverter().convertTo(String.class, response);
        assertEquals("ERROR OCCURED: \n" + out, HttpStatus.SC_OK,

    private String generateBody(final int length) throws
UnsupportedEncodingException {
        final Random rnd = new Random();
        byte[] bytes = new byte[length];
        return new String(bytes);

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() {




View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message