[jira] [Commented] (CAMEL-10492) Camel Servlet, attachment object is empty

2016-11-29 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15704689#comment-15704689
 ] 

Claus Ibsen commented on CAMEL-10492:
-

Ah I think maybe in the past attachmentMultipartBinding=true turned off stream 
caching to make it work, so we could likely do that again.

> Camel Servlet, attachment object is empty
> -
>
> Key: CAMEL-10492
> URL: https://issues.apache.org/jira/browse/CAMEL-10492
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http-common, camel-servlet
>Affects Versions: 2.18.0
>Reporter: Fabrizio Spataro
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: Future
>
> Attachments: camel-example-servlet-attachment.zip
>
>
> I send a multipart form data to my camel servlet, before camel 2.18 
> attachment object is ok now is empty!
> Now i have an *header* every form field but every field is java.lang.String
> So, I can not post any binary file.
> This is my web.xml filter
> {code:xml}
>   
>   MultipartFilter
>   
> org.eclipse.jetty.servlets.MultiPartFilter
>   
>   
>   MultipartFilter
>   CamelServlet
>   
> {code}
> Into zip file, you can found an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10492) Camel Servlet, attachment object is empty

2016-11-28 Thread Fabrizio Spataro (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15701770#comment-15701770
 ] 

Fabrizio Spataro commented on CAMEL-10492:
--

I found a workaround to fix my problem:

Updating my software to 2.18 version my attachments aren't available, now my 
servlet code is:

{code:xml}

{code}

i am using two parameters:
 - disableStreamCache, *is original problem*. With streamcache enable 
attachment files aren't available to jetty multicast parser
 - attachmentMultipartBinding, to enable AttachmentHttpBinding into servlet 
endpoint 

my old code is:

{code:xml}

{code}

[~davsclaus] evaluate you what to do with this issue!

> Camel Servlet, attachment object is empty
> -
>
> Key: CAMEL-10492
> URL: https://issues.apache.org/jira/browse/CAMEL-10492
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http-common, camel-servlet
>Affects Versions: 2.18.0
>Reporter: Fabrizio Spataro
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: Future
>
> Attachments: camel-example-servlet-attachment.zip
>
>
> I send a multipart form data to my camel servlet, before camel 2.18 
> attachment object is ok now is empty!
> Now i have an *header* every form field but every field is java.lang.String
> So, I can not post any binary file.
> This is my web.xml filter
> {code:xml}
>   
>   MultipartFilter
>   
> org.eclipse.jetty.servlets.MultiPartFilter
>   
>   
>   MultipartFilter
>   CamelServlet
>   
> {code}
> Into zip file, you can found an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10492) Camel Servlet, attachment object is empty

2016-11-28 Thread Fabrizio Spataro (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15701561#comment-15701561
 ] 

Fabrizio Spataro commented on CAMEL-10492:
--

I have found a bug into this code. 

I am trying to fix it!

{code:java}

final class AttachmentHttpBinding extends DefaultHttpBinding {
..
protected void populateAttachments(HttpServletRequest request, HttpMessage 
message) {
try {
Collection parts = request.getParts();
for (Part part : parts) {
DataSource ds = new PartDataSource(part);
Attachment attachment = new DefaultAttachment(ds);
for (String headerName : part.getHeaderNames()) {
for (String headerValue : part.getHeaders(headerName)) {
attachment.addHeader(headerName, headerValue);
}
}
message.addAttachmentObject(part.getName(), attachment);
}
} catch (Exception e) {
throw new RuntimeCamelException("Cannot populate attachments", e);
}
}
...
}
{code}

> Camel Servlet, attachment object is empty
> -
>
> Key: CAMEL-10492
> URL: https://issues.apache.org/jira/browse/CAMEL-10492
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http-common, camel-servlet
>Affects Versions: 2.18.0
>Reporter: Fabrizio Spataro
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: Future
>
> Attachments: camel-example-servlet-attachment.zip
>
>
> I send a multipart form data to my camel servlet, before camel 2.18 
> attachment object is ok now is empty!
> Now i have an *header* every form field but every field is java.lang.String
> So, I can not post any binary file.
> This is my web.xml filter
> {code:xml}
>   
>   MultipartFilter
>   
> org.eclipse.jetty.servlets.MultiPartFilter
>   
>   
>   MultipartFilter
>   CamelServlet
>   
> {code}
> Into zip file, you can found an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10492) Camel Servlet, attachment object is empty

2016-11-22 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15686118#comment-15686118
 ] 

Claus Ibsen commented on CAMEL-10492:
-

You need to test with latest code and turn on that option. And dive in the code 
and track down the issue on your end. It may depend on what content you send to 
the servet and what servlet container you use etc.

> Camel Servlet, attachment object is empty
> -
>
> Key: CAMEL-10492
> URL: https://issues.apache.org/jira/browse/CAMEL-10492
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http-common, camel-servlet
>Affects Versions: 2.18.0
>Reporter: Fabrizio Spataro
>Assignee: Claus Ibsen
> Fix For: Future
>
> Attachments: camel-example-servlet-attachment.zip
>
>
> I send a multipart form data to my camel servlet, before camel 2.18 
> attachment object is ok now is empty!
> Now i have an *header* every form field but every field is java.lang.String
> So, I can not post any binary file.
> This is my web.xml filter
> {code:xml}
>   
>   MultipartFilter
>   
> org.eclipse.jetty.servlets.MultiPartFilter
>   
>   
>   MultipartFilter
>   CamelServlet
>   
> {code}
> Into zip file, you can found an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10492) Camel Servlet, attachment object is empty

2016-11-21 Thread Fabrizio Spataro (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15683561#comment-15683561
 ] 

Fabrizio Spataro commented on CAMEL-10492:
--

[~davsclaus] This bug is more complex than it looks. When i set 
attachmentMultipartBinding property i have another error.

It isn't a jetty bug (i had test it with junit) but it, i suppose, is a camel 
body trasformation bug. I do not know so thoroughly to understand it. Can you 
help me?

You can use my zip attach file to debug it!

Stacktrace

{code}
org.apache.camel.RuntimeCamelException: Cannot populate attachments
at 
org.apache.camel.component.servlet.AttachmentHttpBinding.populateAttachments(AttachmentHttpBinding.java:58)
at 
org.apache.camel.http.common.DefaultHttpBinding.readBody(DefaultHttpBinding.java:209)
at 
org.apache.camel.http.common.DefaultHttpBinding.readRequest(DefaultHttpBinding.java:107)
at org.apache.camel.http.common.HttpMessage.(HttpMessage.java:52)
at 
org.apache.camel.http.common.CamelServlet.doService(CamelServlet.java:169)
at 
org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:830)
at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:551)
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1589)
at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1213)
at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:486)
at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1552)
at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1126)
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:118)
at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:549)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:254)
at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:269)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:97)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at 
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Missing content for multipart request
at 
org.eclipse.jetty.util.MultiPartInputStreamParser.parse(MultiPartInputStreamParser.java:541)
at 
org.eclipse.jetty.util.MultiPartInputStreamParser.getParts(MultiPartInputStreamParser.java:429)
at org.eclipse.jetty.server.Request.getParts(Request.java:2300)
at org.eclipse.jetty.server.Request.getParts(Request.java:2279)
{code}



> Camel Servlet, attachment object is empty
> -
>
> Key: CAMEL-10492
> URL: https://issues.apache.org/jira/browse/CAMEL-10492
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http-common, camel-servlet
>Affects Versions: 2.18.0
>Reporter: Fabrizio Spataro
>Assignee: Claus Ibsen
> Fix For: 2.18.1, 2.19.0
>
> Attachments: camel-example-servlet-attachment.zip
>
>
> I send a multipart form data to my camel servlet, before camel 2.18 
> attachment object is ok now is empty!
> Now i have an *header* every form field but every field is java.lang.String
> So, I can not post any binary file.
> This is my web.xml filter
> {code:xml}
>   
>   MultipartFilter
>   
> org.eclipse.jetty.servlets.MultiPartFilter
>   
>   
>   MultipartFilter
>   CamelServlet
>   
> {code}
> Into zip file, you can found an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10492) Camel Servlet, attachment object is empty

2016-11-21 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15683059#comment-15683059
 ] 

Claus Ibsen commented on CAMEL-10492:
-

I made it possible to configure this on endpoint in next release.

> Camel Servlet, attachment object is empty
> -
>
> Key: CAMEL-10492
> URL: https://issues.apache.org/jira/browse/CAMEL-10492
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http-common, camel-servlet
>Affects Versions: 2.18.0
>Reporter: Fabrizio Spataro
> Attachments: camel-example-servlet-attachment.zip
>
>
> I send a multipart form data to my camel servlet, before camel 2.18 
> attachment object is ok now is empty!
> Now i have an *header* every form field but every field is java.lang.String
> So, I can not post any binary file.
> This is my web.xml filter
> {code:xml}
>   
>   MultipartFilter
>   
> org.eclipse.jetty.servlets.MultiPartFilter
>   
>   
>   MultipartFilter
>   CamelServlet
>   
> {code}
> Into zip file, you can found an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10492) Camel Servlet, attachment object is empty

2016-11-21 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15683044#comment-15683044
 ] 

Claus Ibsen commented on CAMEL-10492:
-

You need to turn set that = true on the servlet component.

Add a bean configuration in your xml file


  



> Camel Servlet, attachment object is empty
> -
>
> Key: CAMEL-10492
> URL: https://issues.apache.org/jira/browse/CAMEL-10492
> Project: Camel
>  Issue Type: Bug
>  Components: camel-http-common, camel-servlet
>Affects Versions: 2.18.0
>Reporter: Fabrizio Spataro
> Attachments: camel-example-servlet-attachment.zip
>
>
> I send a multipart form data to my camel servlet, before camel 2.18 
> attachment object is ok now is empty!
> Now i have an *header* every form field but every field is java.lang.String
> So, I can not post any binary file.
> This is my web.xml filter
> {code:xml}
>   
>   MultipartFilter
>   
> org.eclipse.jetty.servlets.MultiPartFilter
>   
>   
>   MultipartFilter
>   CamelServlet
>   
> {code}
> Into zip file, you can found an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)