camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From satyavrat <bit.sa...@gmail.com>
Subject https://issues.apache.org/jira/browse/CAMEL-4871 : not fixed in camel jetty
Date Mon, 23 Nov 2015 13:41:12 GMT
Hi,
I am using camel jetty as proxy server.
Its working with most of my services but with tracmore its giving problem.

After some investigation I found that issue
https://issues.apache.org/jira/browse/CAMEL-4871 is not considered in jetty
component.

Can you please help me how I can resolve it ?

Also how I can avoid its from reading body of message , It should just
forward it to next jetty.

I am using below:



*Code is like:*from("jetty:http://0.0.0.0:8080/?continuationTimeout=" +
responseTimeOut + "&httpClient.idleTimeout=" + responseTimeOut
                        + "&httpClient.timeout=" + responseTimeOut +
"&matchOnUriPrefix=true")
.to("jetty:" + destinationUrl + "?continuationTimeout=" + responseTimeOut +
"&httpClient.idleTimeout=" + responseTimeOut
                + "&httpClient.timeout=" + responseTimeOut
                +
"&bridgeEndpoint=true&enableMultipartFilter=false&useContinuation=true&enableCORS=true&"
+ "throwExceptionOnFailure=false")



*POM:*<dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <version>2.15.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jetty</artifactId>
            <version>2.15.2</version>
        </dependency>



*Reason:*
My message body is below :

&c1=admin&c2=admin&c3=Login&Qform__FormId=LoginForm&Qform__FormState......

Its starting with & , and when its executing below lines its throwing
exception from class DefaultHttpBinding:

for (String param : body.split("&")) {
                    String[] pair = param.split("=", 2);
                    *if (pair.length == 2) {*

*Exception :*

WARN  2015-11-16 17:22:03,272 [qtp539480478-23 -
/tracmor/login.php][ServletHandler.java:554] : /tracmor/login.php
org.apache.camel.RuntimeCamelException: Cannot read request parameters due
Invalid parameter, expected to be a pair but was
        at
org.apache.camel.component.http.DefaultHttpBinding.readRequest(DefaultHttpBinding.java:111)
        at
org.apache.camel.component.http.HttpMessage.<init>(HttpMessage.java:52)
        at
org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:126)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
        at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
        at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)
        at
org.eclipse.jetty.servlets.MultiPartFilter.doFilter(MultiPartFilter.java:136)
        at
org.apache.camel.component.jetty.CamelFilterWrapper.doFilter(CamelFilterWrapper.java:43)
        at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
        at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
        at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
        at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:366)
        at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
        at
org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
        at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
        at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
        at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
        at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
        at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Invalid parameter, expected
to be a pair but was
        at
*org.apache.camel.component.http.DefaultHttpBinding.populateRequestParameters(DefaultHttpBinding.java:196)
at
org.apache.camel.component.http.DefaultHttpBinding.readRequest(DefaultHttpBinding.java:109)*
        ... 26 more

Thank you in advance.
-
Satyavrat

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message