Quantcast

Jetty proxy Rest service fails for file uploading

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Jetty proxy Rest service fails for file uploading

berdoni
I have deployed on SMX the following Camel route that proxies all ReST request to the real ReST service provider (Tomcat). All ReST calls to SMX routed successfully however a saveDocument service that uploads PDF files fail.

public void configure() throws Exception {
from("jetty:http://{{smx.host}}:{{smx.rest-proxy-port}}/?matchOnUriPrefix=true")
.to("jetty:http://{{real-server-address}}:{{real-ws-port}}/?bridgeEndpoint=true&throwExceptionOnFailure=false")
}

The following exception is logged in servicemix.log.

ERROR | HttpClient-1374  | DefaultErrorHandler              | 95 - org.apache.camel.camel-core - 2.10.4 | Failed delivery for... Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExchangeException: JettyClient failed cause by: null. Exchange[Message: [Body is instance of org.apache.cam
el.StreamCache]]. Caused by: [java.lang.IndexOutOfBoundsException - null]
org.apache.camel.CamelExchangeException: JettyClient failed cause by: null. Exchange[Message: [Body is instance of org.apache.camel.StreamCache]]. Caused by: [java.lang.IndexOutOfBoundsException - null]

Do I have to perform some additional processing or configuration before redirect the call to the real ReST service? The route works when I use a small txt files up to 6-7KB.

Is it possible to set jetty to accept big size files?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

Willem.Jiang
camel-jetty support the multipart form post by default, it could cause some trouble if you just want to proxy the request of multipart form post.
You can disable this feature by setting enableMultipartFilter option to be false like this.

from("jetty:http://{{smx.host}}:{{smx.rest-proxy-port}}/?matchOnUriPrefix=true&enableMultipartFilter=false")
.to("jetty:http://{{real-server-address}}:{{real-ws-port}}/?bridgeEndpoint=true&throwExceptionOnFailure=false")


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, November 7, 2013 at 4:42 PM, berdoni wrote:

> I have deployed on SMX the following Camel route that proxies all ReST
> request to the real ReST service provider (Tomcat). All ReST calls to SMX
> routed successfully however a saveDocument service that uploads PDF files
> fail.
>  
> public void configure() throws Exception {
> from("jetty:http://{{smx.host}}:{{smx.rest-proxy-port}}/?matchOnUriPrefix=true")
> .to("jetty:http://{{real-server-address}}:{{real-ws-port}}/?bridgeEndpoint=true&throwExceptionOnFailure=false")
> }
>  
> The following exception is logged in servicemix.log.
>  
> ERROR | HttpClient-1374 | DefaultErrorHandler | 95 -
> org.apache.camel.camel-core - 2.10.4 | Failed delivery for... Exhausted
> after delivery attempt: 1 caught: org.apache.camel.CamelExchangeException:
> JettyClient failed cause by: null. Exchange[Message: [Body is instance of
> org.apache.cam
> el.StreamCache]]. Caused by: [java.lang.IndexOutOfBoundsException - null]
> org.apache.camel.CamelExchangeException: JettyClient failed cause by: null.
> Exchange[Message: [Body is instance of org.apache.camel.StreamCache]].
> Caused by: [java.lang.IndexOutOfBoundsException - null]
>  
> Do I have to perform some additional processing or configuration before
> redirect the call to the real ReST service? The route works when I use a
> small txt files up to 6-7KB.
>  
> Is it possible to set jetty to accept big size files?  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Jetty-proxy-Rest-service-fails-for-file-uploading-tp5742769.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

berdoni
tnx Williem.

I get the same error with enableMultipartFilter=false setting:
[Body is instance of org.apache.camel.StreamCache]]. Caused by: [java.lang.IndexOutOfBoundsException - null]

I get a similar error when I disable stream cache.
from("../../?matchOnUriPrefix=true&enableMultipartFilter=false&disableStreamCache=true")

The error message is:
..Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExchangeException: JettyClient failed cause by: null. Exchange[Message: [Body is instance of java.io.InputStream]]. Caused by: [java.lang.IndexOutOfBoundsException - null]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

Willem.Jiang
It’s strange.
Can you change the route to use camel-http or camel-http4 component to proxy the request?
In this way we can tell if it is Jetty Client issue.

from("jetty:http://{{smx.host}}:{{smx.rest-proxy-port}}/?matchOnUriPrefix=true")
.to("http://{{real-server-address}}:{{real-ws-port}}/?bridgeEndpoint=true&throwExceptionOnFailure=false")


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, November 7, 2013 at 7:35 PM, berdoni wrote:

> tnx Williem.
>  
> I get the same error with enableMultipartFilter=false setting:
> [Body is instance of org.apache.camel.StreamCache]]. Caused by:
> [java.lang.IndexOutOfBoundsException - null]
>  
> I get a similar error when I disable stream cache.
> from("../../?matchOnUriPrefix=true&enableMultipartFilter=false&disableStreamCache=true")
>  
> The error message is:
> ..Exhausted after delivery attempt: 1 caught:
> org.apache.camel.CamelExchangeException: JettyClient failed cause by: null.
> Exchange[Message: [Body is instance of java.io.InputStream]]. Caused by:
> [java.lang.IndexOutOfBoundsException - null]
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Jetty-proxy-Rest-service-fails-for-file-uploading-tp5742769p5742778.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

berdoni
Simple Rest services are proxied successfully as with jetty.The saveDocument Rest service fails again for a pdf file. It works OK for small txt files. All at all same behavior but different error message.

2013-11-07 14:26:39,482 | ERROR | p1609546665-2068 | DefaultErrorHandler              | 95 - org.apache.camel.camel-core - 2.10.4 | Failed delivery for (MessageId: HP-50802-1383742721528-86-4 on ExchangeId
: HP-50802-1383742721528-86-3). Exhausted after delivery attempt: 1 caught: org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://...:8080/.../saveDocument with statusCode: 400
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

Willem.Jiang
Can you show me the whole stack trance?
It could be helpful if you can catch the HTTP Request and Response without using the proxy.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, November 7, 2013 at 8:34 PM, berdoni wrote:

> Simple Rest services are proxied successfully as with jetty.The saveDocument
> Rest service fails again for a pdf file. It works OK for small txt files.
> All at all same behavior but different error message.
>  
> 2013-11-07 14:26:39,482 | ERROR | p1609546665-2068 | DefaultErrorHandler  
> | 95 - org.apache.camel.camel-core - 2.10.4 | Failed delivery for
> (MessageId: HP-50802-1383742721528-86-4 on ExchangeId
> : HP-50802-1383742721528-86-3). Exhausted after delivery attempt: 1 caught:
> org.apache.camel.component.http.HttpOperationFailedException: HTTP operation
> failed invoking http://...:8080/.../saveDocument with statusCode: 400
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Jetty-proxy-Rest-service-fails-for-file-uploading-tp5742769p5742780.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

berdoni
This post was updated on .
I have enabled DEBUG logging. The camel route proxies a request from JMeter to a Tomcat webapp (JMeter -> SMX(Camel) -> Tomcat).Here it the full stack trace:

10:25:53,974 | DEBUG | heckpoint Worker | MessageDatabase                  | 78 - org.apache.activemq.activemq-core - 5.7.0 | Checkpoint started.
10:25:53,977 | DEBUG | heckpoint Worker | MessageDatabase                  | 78 - org.apache.activemq.activemq-core - 5.7.0 | Checkpoint done.
10:25:58,326 | DEBUG | /ce/saveDocument | Server                           | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | REQUEST /my-app/ce/saveDocument on org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection@78d53fb8@127.0.0.1:8081<->127.0.0.1:52016
10:25:58,326 | DEBUG | /ce/saveDocument | ContextHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | scope null||/my-app/ce/saveDocument @ o.e.j.s.ServletContextHandler{/,null}
10:25:58,326 | DEBUG | /ce/saveDocument | ContextHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | context=||/my-app/ce/saveDocument @ o.e.j.s.ServletContextHandler{/,null}
10:25:58,326 | DEBUG | /ce/saveDocument | ServletHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | servlet ||/my-app/ce/saveDocument -> org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
10:25:58,326 | DEBUG | /ce/saveDocument | ServletHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | chain=org.apache.camel.component.jetty.CamelFilterWrapper-835782266->org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
10:25:58,326 | DEBUG | /ce/saveDocument | ServletHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | call filter org.apache.camel.component.jetty.CamelFilterWrapper-835782266
10:25:58,327 | DEBUG | /ce/saveDocument | ServletHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | call servlet org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
10:25:58,332 | DEBUG | /ce/saveDocument | SendProcessor                    | 95 - org.apache.camel.camel-core - 2.10.4 | >>>> Endpoint[http://devel:8080/] Exchange[Message: [Body is instance of org.apache.camel.StreamCache]]
10:25:58,334 | DEBUG | /ce/saveDocument | HttpExchange                     | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | URI = http://devel:8080/my-app/ce/saveDocument
10:25:58,337 | DEBUG | /ce/saveDocument | JettyHttpProducer                | 178 - org.apache.camel.camel-jetty - 2.10.4 | Sending HTTP request to: http//devel:8080/my-app/ce/saveDocument
10:25:58,340 | DEBUG | /ce/saveDocument | Server                           | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | RESPONSE /my-app/ce/saveDocument  200
10:25:58,340 | DEBUG | nt-123 Selector0 | nio                              | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | Channels with connection pending: 0
10:25:58,340 | DEBUG | tp1844774651-141 | AsyncHttpConnection              | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | suspended org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection@78d53fb8@127.0.0.1:8081<->127.0.0.1:52016
10:25:58,341 | DEBUG | nt-123 Selector0 | nio                              | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | Required scheduleWrite SCEP@1778694983java.nio.channels.SocketChannel[connected local=/10.250.23.152:52017 remote=devel/10.254.241.70:8080][o=true d=false,io=0,w=true,rb=false,wb=false]
10:25:58,348 | DEBUG | HttpClient-126   | HttpConnection                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | Failure on JettyContentExchange@6c2e6bfa=POST//devel:8080/my-app/ce/saveDocument#CONNECTED(1ms)->SENDING(5ms)sent=5ms
java.lang.IndexOutOfBoundsException
        at java.nio.Buffer.checkIndex(Buffer.java:532)[:1.7.0_17]
        at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:300)[:1.7.0_17]
        at org.eclipse.jetty.io.nio.DirectNIOBuffer.poke(DirectNIOBuffer.java:130)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.io.AbstractBuffer.put(AbstractBuffer.java:465)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.http.HttpFields$Field.putTo(HttpFields.java:1314)[108:org.eclipse.jetty.http:7.5.4.v20111024]
        at org.eclipse.jetty.http.HttpGenerator.completeHeader(HttpGenerator.java:655)[108:org.eclipse.jetty.http:7.5.4.v20111024]
        at org.eclipse.jetty.client.HttpConnection.commitRequest(HttpConnection.java:539)[106:org.eclipse.jetty.client:7.5.4.v20111024]
        at org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:216)[106:org.eclipse.jetty.client:7.5.4.v20111024]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[111:org.eclipse.jetty.util:7.5.4.v20111024]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[111:org.eclipse.jetty.util:7.5.4.v20111024]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]
10:25:58,348 | WARN  | HttpClient-126   | HttpExchange                     | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | EXCEPTION JettyContentExchange@6c2e6bfa=POST//devel:8080/my-app/ce/saveDocument#SENDING(6ms)->EXCEPTED(0ms)sent=6ms
java.lang.IndexOutOfBoundsException
        at java.nio.Buffer.checkIndex(Buffer.java:532)[:1.7.0_17]
        at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:300)[:1.7.0_17]
        at org.eclipse.jetty.io.nio.DirectNIOBuffer.poke(DirectNIOBuffer.java:130)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.io.AbstractBuffer.put(AbstractBuffer.java:465)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.http.HttpFields$Field.putTo(HttpFields.java:1314)[108:org.eclipse.jetty.http:7.5.4.v20111024]
        at org.eclipse.jetty.http.HttpGenerator.completeHeader(HttpGenerator.java:655)[108:org.eclipse.jetty.http:7.5.4.v20111024]
        at org.eclipse.jetty.client.HttpConnection.commitRequest(HttpConnection.java:539)[106:org.eclipse.jetty.client:7.5.4.v20111024]
        at org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:216)[106:org.eclipse.jetty.client:7.5.4.v20111024]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[111:org.eclipse.jetty.util:7.5.4.v20111024]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[111:org.eclipse.jetty.util:7.5.4.v20111024]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]
10:25:58,350 | DEBUG | HttpClient-126   | DefaultErrorHandler              | 95 - org.apache.camel.camel-core - 2.10.4 | Failed delivery for (MessageId: ID-HP-51981-1383898833207-0-4 on ExchangeId: ID-HP-51981-1383898833207-0-3). On delivery attempt: 0 caught: org.apache.camel.CamelExchangeException: JettyClient failed cause by: null. Exchange[Message: [Body is instance of org.apache.camel.StreamCache]]. Caused by: [java.lang.IndexOutOfBoundsException - null]
10:25:58,350 | DEBUG | /ce/saveDocument | Server                           | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | REQUEST /my-app/ce/saveDocument on org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection@78d53fb8@127.0.0.1:8081<->127.0.0.1:52016
10:25:58,350 | ERROR | HttpClient-126   | DefaultErrorHandler              | 95 - org.apache.camel.camel-core - 2.10.4 | Failed delivery for (MessageId: ID-HP-51981-1383898833207-0-4 on ExchangeId: ID-HP-51981-1383898833207-0-3). Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExchangeException: JettyClient failed cause by: null. Exchange[Message: [Body is instance of org.apache.camel.StreamCache]]. Caused by: [java.lang.IndexOutOfBoundsException - null]
org.apache.camel.CamelExchangeException: JettyClient failed cause by: null. Exchange[Message: [Body is instance of org.apache.camel.StreamCache]]. Caused by: [java.lang.IndexOutOfBoundsException - null]
        at org.apache.camel.component.jetty.JettyContentExchange.doTaskCompleted(JettyContentExchange.java:214)[178:org.apache.camel.camel-jetty:2.10.4]
        at org.apache.camel.component.jetty.JettyContentExchange.onException(JettyContentExchange.java:134)[178:org.apache.camel.camel-jetty:2.10.4]
        at org.eclipse.jetty.client.HttpExchange$Listener.onException(HttpExchange.java:1094)[106:org.eclipse.jetty.client:7.5.4.v20111024]
        at org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:319)[106:org.eclipse.jetty.client:7.5.4.v20111024]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[111:org.eclipse.jetty.util:7.5.4.v20111024]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[111:org.eclipse.jetty.util:7.5.4.v20111024]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]
Caused by: java.lang.IndexOutOfBoundsException
        at java.nio.Buffer.checkIndex(Buffer.java:532)[:1.7.0_17]
        at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:300)[:1.7.0_17]
        at org.eclipse.jetty.io.nio.DirectNIOBuffer.poke(DirectNIOBuffer.java:130)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.io.AbstractBuffer.put(AbstractBuffer.java:465)[103:org.eclipse.jetty.io:7.5.4.v20111024]
        at org.eclipse.jetty.http.HttpFields$Field.putTo(HttpFields.java:1314)[108:org.eclipse.jetty.http:7.5.4.v20111024]
        at org.eclipse.jetty.http.HttpGenerator.completeHeader(HttpGenerator.java:655)[108:org.eclipse.jetty.http:7.5.4.v20111024]
        at org.eclipse.jetty.client.HttpConnection.commitRequest(HttpConnection.java:539)[106:org.eclipse.jetty.client:7.5.4.v20111024]
        at org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:216)[106:org.eclipse.jetty.client:7.5.4.v20111024]
        ... 5 more
10:25:58,350 | DEBUG | /ce/saveDocument | ContextHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | scope null||/my-app/ce/saveDocument @ o.e.j.s.ServletContextHandler{/,null}
10:25:58,351 | DEBUG | /ce/saveDocument | ContextHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | context=||/my-app/ce/saveDocument @ o.e.j.s.ServletContextHandler{/,null}
10:25:58,351 | DEBUG | /ce/saveDocument | ServletHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | servlet ||/my-app/ce/saveDocument -> org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
10:25:58,351 | DEBUG | /ce/saveDocument | ServletHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | chain=org.apache.camel.component.jetty.CamelFilterWrapper-835782266->org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
10:25:58,351 | DEBUG | nt-123 Selector0 | nio                              | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | destroyEndPoint SCEP@1778694983java.nio.channels.SocketChannel[closed][o=false d=false,io=5,w=false,rb=false,wb=false]
10:25:58,351 | DEBUG | /ce/saveDocument | ServletHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | call filter org.apache.camel.component.jetty.CamelFilterWrapper-835782266
10:25:58,351 | DEBUG | /ce/saveDocument | ServletHandler                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | call servlet org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
10:25:58,354 | DEBUG | /ce/saveDocument | Server                           | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | RESPONSE /my-app/ce/saveDocument  500
10:25:58,977 | DEBUG | heckpoint Worker | MessageDatabase                  | 78 - org.apache.activemq.activemq-core - 5.7.0 | Checkpoint started.
10:25:58,980 | DEBUG | heckpoint Worker | MessageDatabase                  | 78 - org.apache.activemq.activemq-core - 5.7.0 | Checkpoint done.
10:26:03,358 | DEBUG | 51-142 Selector0 | nio                              | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | destroyEndPoint SCEP@388534836java.nio.channels.SocketChannel[closed][o=false d=false,io=1,w=true,rb=false,wb=false]
10:26:03,358 | DEBUG | 51-142 Selector0 | HttpConnection                   | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | closed org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection@78d53fb8@127.0.0.1:8081<->127.0.0.1:52016
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

Willem.Jiang
It’s hard to tell the cause of IndexOutOfBoundsException.
(https://issues.apache.org/jira/browse/CAMEL-6943)What’s your quest message look like?
Did you just submit POST request with a Form to the Proxy?


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Friday, November 8, 2013 at 4:31 PM, berdoni wrote:

> I have enabled DEBUG logging. Here it the full stack trace:
>  
> 10:25:53,974 | DEBUG | heckpoint Worker | MessageDatabase |
> 78 - org.apache.activemq.activemq-core - 5.7.0 | Checkpoint started.
> 10:25:53,977 | DEBUG | heckpoint Worker | MessageDatabase |
> 78 - org.apache.activemq.activemq-core - 5.7.0 | Checkpoint done.
> 10:25:58,326 | DEBUG | /ce/saveDocument | Server |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | REQUEST
> /my-app/ce/saveDocument on
> org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection@78d53fb8@127.0.0.1 (mailto:78d53fb8@127.0.0.1):8081<->127.0.0.1:52016
> 10:25:58,326 | DEBUG | /ce/saveDocument | ContextHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | scope
> null||/my-app/ce/saveDocument @ o.e.j.s.ServletContextHandler{/,null}
> 10:25:58,326 | DEBUG | /ce/saveDocument | ContextHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 |
> context=||/my-app/ce/saveDocument @ o.e.j.s.ServletContextHandler{/,null}
> 10:25:58,326 | DEBUG | /ce/saveDocument | ServletHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | servlet
> ||/my-app/ce/saveDocument ->
> org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
> 10:25:58,326 | DEBUG | /ce/saveDocument | ServletHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 |
> chain=org.apache.camel.component.jetty.CamelFilterWrapper-835782266->org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
> 10:25:58,326 | DEBUG | /ce/saveDocument | ServletHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | call filter
> org.apache.camel.component.jetty.CamelFilterWrapper-835782266
> 10:25:58,327 | DEBUG | /ce/saveDocument | ServletHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | call servlet
> org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
> 10:25:58,332 | DEBUG | /ce/saveDocument | SendProcessor |
> 95 - org.apache.camel.camel-core - 2.10.4 | >>>>
> Endpoint[http://devel:8080/] Exchange[Message: [Body is instance of
> org.apache.camel.StreamCache]]
> 10:25:58,334 | DEBUG | /ce/saveDocument | HttpExchange |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | URI =
> http://devel:8080/my-app/ce/saveDocument
> 10:25:58,337 | DEBUG | /ce/saveDocument | JettyHttpProducer |
> 178 - org.apache.camel.camel-jetty - 2.10.4 | Sending HTTP request to:
> http//devel:8080/my-app/ce/saveDocument
> 10:25:58,340 | DEBUG | /ce/saveDocument | Server |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | RESPONSE
> /my-app/ce/saveDocument 200
> 10:25:58,340 | DEBUG | nt-123 Selector0 | nio |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | Channels with connection
> pending: 0
> 10:25:58,340 | DEBUG | tp1844774651-141 | AsyncHttpConnection |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | suspended
> org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection@78d53fb8@127.0.0.1 (mailto:78d53fb8@127.0.0.1):8081<->127.0.0.1:52016
> 10:25:58,341 | DEBUG | nt-123 Selector0 | nio |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | Required scheduleWrite
> [hidden email] (mailto:[hidden email])[connected
> local=/10.250.23.152:52017 remote=devel/10.254.241.70:8080][o=true
> d=false,io=0,w=true,rb=false,wb=false]
> 10:25:58,348 | DEBUG | HttpClient-126 | HttpConnection |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | Failure on
> JettyContentExchange@6c2e6bfa=POST//devel:8080/my-app/ce/saveDocument#CONNECTED(1ms)->SENDING(5ms)sent=5ms
> java.lang.IndexOutOfBoundsException
> at java.nio.Buffer.checkIndex(Buffer.java:532)[:1.7.0_17]
> at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:300)[:1.7.0_17]
> at
> org.eclipse.jetty.io.nio.DirectNIOBuffer.poke(DirectNIOBuffer.java:130)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.io.AbstractBuffer.put(AbstractBuffer.java:465)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.http.HttpFields$Field.putTo(HttpFields.java:1314)[108:org.eclipse.jetty.http:7.5.4.v20111024]
> at
> org.eclipse.jetty.http.HttpGenerator.completeHeader(HttpGenerator.java:655)[108:org.eclipse.jetty.http:7.5.4.v20111024]
> at
> org.eclipse.jetty.client.HttpConnection.commitRequest(HttpConnection.java:539)[106:org.eclipse.jetty.client:7.5.4.v20111024]
> at
> org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:216)[106:org.eclipse.jetty.client:7.5.4.v20111024]
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[111:org.eclipse.jetty.util:7.5.4.v20111024]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[111:org.eclipse.jetty.util:7.5.4.v20111024]
> at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]
> 10:25:58,348 | WARN | HttpClient-126 | HttpExchange |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | EXCEPTION
> JettyContentExchange@6c2e6bfa=POST//devel:8080/my-app/ce/saveDocument#SENDING(6ms)->EXCEPTED(0ms)sent=6ms
> java.lang.IndexOutOfBoundsException
> at java.nio.Buffer.checkIndex(Buffer.java:532)[:1.7.0_17]
> at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:300)[:1.7.0_17]
> at
> org.eclipse.jetty.io.nio.DirectNIOBuffer.poke(DirectNIOBuffer.java:130)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.io.AbstractBuffer.put(AbstractBuffer.java:465)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.http.HttpFields$Field.putTo(HttpFields.java:1314)[108:org.eclipse.jetty.http:7.5.4.v20111024]
> at
> org.eclipse.jetty.http.HttpGenerator.completeHeader(HttpGenerator.java:655)[108:org.eclipse.jetty.http:7.5.4.v20111024]
> at
> org.eclipse.jetty.client.HttpConnection.commitRequest(HttpConnection.java:539)[106:org.eclipse.jetty.client:7.5.4.v20111024]
> at
> org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:216)[106:org.eclipse.jetty.client:7.5.4.v20111024]
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[111:org.eclipse.jetty.util:7.5.4.v20111024]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[111:org.eclipse.jetty.util:7.5.4.v20111024]
> at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]
> 10:25:58,350 | DEBUG | HttpClient-126 | DefaultErrorHandler |
> 95 - org.apache.camel.camel-core - 2.10.4 | Failed delivery for (MessageId:
> ID-HP-51981-1383898833207-0-4 on ExchangeId: ID-HP-51981-1383898833207-0-3).
> On delivery attempt: 0 caught: org.apache.camel.CamelExchangeException:
> JettyClient failed cause by: null. Exchange[Message: [Body is instance of
> org.apache.camel.StreamCache]]. Caused by:
> [java.lang.IndexOutOfBoundsException - null]
> 10:25:58,350 | DEBUG | /ce/saveDocument | Server |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | REQUEST
> /my-app/ce/saveDocument on
> org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection@78d53fb8@127.0.0.1 (mailto:78d53fb8@127.0.0.1):8081<->127.0.0.1:52016
> 10:25:58,350 | ERROR | HttpClient-126 | DefaultErrorHandler |
> 95 - org.apache.camel.camel-core - 2.10.4 | Failed delivery for (MessageId:
> ID-HP-51981-1383898833207-0-4 on ExchangeId: ID-HP-51981-1383898833207-0-3).
> Exhausted after delivery attempt: 1 caught:
> org.apache.camel.CamelExchangeException: JettyClient failed cause by: null.
> Exchange[Message: [Body is instance of org.apache.camel.StreamCache]].
> Caused by: [java.lang.IndexOutOfBoundsException - null]
> org.apache.camel.CamelExchangeException: JettyClient failed cause by: null.
> Exchange[Message: [Body is instance of org.apache.camel.StreamCache]].
> Caused by: [java.lang.IndexOutOfBoundsException - null]
> at
> org.apache.camel.component.jetty.JettyContentExchange.doTaskCompleted(JettyContentExchange.java:214)[178:org.apache.camel.camel-jetty:2.10.4]
> at
> org.apache.camel.component.jetty.JettyContentExchange.onException(JettyContentExchange.java:134)[178:org.apache.camel.camel-jetty:2.10.4]
> at
> org.eclipse.jetty.client.HttpExchange$Listener.onException(HttpExchange.java:1094)[106:org.eclipse.jetty.client:7.5.4.v20111024]
> at
> org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:319)[106:org.eclipse.jetty.client:7.5.4.v20111024]
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[111:org.eclipse.jetty.util:7.5.4.v20111024]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[111:org.eclipse.jetty.util:7.5.4.v20111024]
> at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]
> Caused by: java.lang.IndexOutOfBoundsException
> at java.nio.Buffer.checkIndex(Buffer.java:532)[:1.7.0_17]
> at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:300)[:1.7.0_17]
> at
> org.eclipse.jetty.io.nio.DirectNIOBuffer.poke(DirectNIOBuffer.java:130)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.io.AbstractBuffer.put(AbstractBuffer.java:465)[103:org.eclipse.jetty.io:7 (<a href="http://org.eclipse.jetty.io:7).5.4.v20111024">http://org.eclipse.jetty.io:7).5.4.v20111024]
> at
> org.eclipse.jetty.http.HttpFields$Field.putTo(HttpFields.java:1314)[108:org.eclipse.jetty.http:7.5.4.v20111024]
> at
> org.eclipse.jetty.http.HttpGenerator.completeHeader(HttpGenerator.java:655)[108:org.eclipse.jetty.http:7.5.4.v20111024]
> at
> org.eclipse.jetty.client.HttpConnection.commitRequest(HttpConnection.java:539)[106:org.eclipse.jetty.client:7.5.4.v20111024]
> at
> org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:216)[106:org.eclipse.jetty.client:7.5.4.v20111024]
> ... 5 more
> 10:25:58,350 | DEBUG | /ce/saveDocument | ContextHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | scope
> null||/my-app/ce/saveDocument @ o.e.j.s.ServletContextHandler{/,null}
> 10:25:58,351 | DEBUG | /ce/saveDocument | ContextHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 |
> context=||/my-app/ce/saveDocument @ o.e.j.s.ServletContextHandler{/,null}
> 10:25:58,351 | DEBUG | /ce/saveDocument | ServletHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | servlet
> ||/my-app/ce/saveDocument ->
> org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
> 10:25:58,351 | DEBUG | /ce/saveDocument | ServletHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 |
> chain=org.apache.camel.component.jetty.CamelFilterWrapper-835782266->org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
> 10:25:58,351 | DEBUG | nt-123 Selector0 | nio |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | destroyEndPoint
> [hidden email] (mailto:[hidden email])[closed][o=false
> d=false,io=5,w=false,rb=false,wb=false]
> 10:25:58,351 | DEBUG | /ce/saveDocument | ServletHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | call filter
> org.apache.camel.component.jetty.CamelFilterWrapper-835782266
> 10:25:58,351 | DEBUG | /ce/saveDocument | ServletHandler |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | call servlet
> org.apache.camel.component.jetty.CamelContinuationServlet-1817225220
> 10:25:58,354 | DEBUG | /ce/saveDocument | Server |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | RESPONSE
> /my-app/ce/saveDocument 500
> 10:25:58,977 | DEBUG | heckpoint Worker | MessageDatabase |
> 78 - org.apache.activemq.activemq-core - 5.7.0 | Checkpoint started.
> 10:25:58,980 | DEBUG | heckpoint Worker | MessageDatabase |
> 78 - org.apache.activemq.activemq-core - 5.7.0 | Checkpoint done.
> 10:26:03,358 | DEBUG | 51-142 Selector0 | nio |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | destroyEndPoint
> [hidden email] (mailto:[hidden email])[closed][o=false
> d=false,io=1,w=true,rb=false,wb=false]
> 10:26:03,358 | DEBUG | 51-142 Selector0 | HttpConnection |
> 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | closed
> org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection@78d53fb8@127.0.0.1 (mailto:78d53fb8@127.0.0.1):8081<->127.0.0.1:52016
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Jetty-proxy-Rest-service-fails-for-file-uploading-tp5742769p5742806.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

berdoni
Hi Willem,

I just perform a POST request from the JMeter. The request is simple and the message is the following:
POST http://127.0.0.1:8081/my-app/ce/saveDocument

POST data:
parentFolderPath=%2FPENDING_FOLDER%2F&file=JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9Qcm9kdWNlcihHUEwgR2hvc3RzY3JpcHQgOS4wNTsgbW9kaWZpZWQgdXNpbmcgaVRleHRTaGFycCA1LjEuMiBcKGNcKSAxVDNYVCBCVkJBKS9DcmVhdGlvbkRhdGUoRDoyMDEyMDYyMDE1MDg1NSswMycwMCcpL01vZERhdGUoRDoyMDEyMDYyMDE1MDkxMiswMycwMCcpL1RpdGxlKP7%2FAFMAYQBtAHAAbABlACAAVABNADMAIABBAHAAcABsAGkAYwBhAHQAaQBvA....

[no cookies]

Request Headers:
Content-Length: 38510
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jetty proxy Rest service fails for file uploading

berdoni
This post was updated on .
I have implemented a Multipart ReST file upload service for testing the route in case of a multipart WS.

The following route works OK for multipart:
from("jetty:http://.../?matchOnUriPrefix=true&enableMultipartFilter=false")
                .noStreamCaching()
                .log("Service Proxied")
                .to("jetty:<a href="http://...:../?bridgeEndpoint=true&throwExceptionOnFailure=false">http://...:../?bridgeEndpoint=true&throwExceptionOnFailure=false");

Still cannot find what is going wrong with the first WS.
Loading...