You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ramrubio <ra...@yahoo.com> on 2013/11/21 23:54:19 UTC

Stream Caching when uploading a binary file

Camel version = 2.12.1

I'm using camel to implement an http proxy.  streamcache is enabled but when
a client submits a http file upload request the following exception occurs.

The proxy is working great for all other requests.  Does streamcache support
binary file upload?  Is there any other configuration that needs to be done
to enable binary file upload?  All other settings associated with
streamcache are set to default values.

Caused by: org.apache.camel.InvalidPayloadException: No body available of
type: java.lang.String but has value:
org.apache.camel.converter.stream.FileInputStreamCache@c6247a of type:
org.apache.camel.converter.stream.FileInputStreamCache on: Message: [Body is
instance of org.apache.camel.StreamCache]. Caused by: Error during type
conversion from type: org.apache.camel.converter.stream.FileInputStreamCache
to the required type: java.lang.String with value
org.apache.camel.converter.stream.FileInputStreamCache@c6247a due
java.lang.OutOfMemoryError: Java heap space. Exchange[Message: [Body is
instance of org.apache.camel.StreamCache]]. Caused by:
[org.apache.camel.TypeConversionException - Error during type conversion
from type: org.apache.camel.converter.stream.FileInputStreamCache to the
required type: java.lang.String with value
org.apache.camel.converter.stream.FileInputStreamCache@c6247a due
java.lang.OutOfMemoryError: Java heap space]
	at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:101)
	at
org.apache.camel.builder.ExpressionBuilder$38.evaluate(ExpressionBuilder.java:936)
	... 48 more
Caused by: org.apache.camel.TypeConversionException: Error during type
conversion from type: org.apache.camel.converter.stream.FileInputStreamCache
to the required type: java.lang.String with value
org.apache.camel.converter.stream.FileInputStreamCache@c6247a due
java.lang.OutOfMemoryError: Java heap space
	at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:173)
	at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:99)
	... 49 more
Caused by: org.apache.camel.RuntimeCamelException:
java.lang.OutOfMemoryError: Java heap space
	at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)
	at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:986)
	at
org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
	at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:275)
	at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:164)
	... 50 more



--
View this message in context: http://camel.465427.n5.nabble.com/Stream-Caching-when-uploading-a-binary-file-tp5743668.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Stream Caching when uploading a binary file

Posted by ramrubio <ra...@yahoo.com>.
Hi Claus,

running with -XX:MaxPermSize=256M

file size is 378MB.

My understanding was that files larger than 128KB were streamed for Camel
version 2.12.1.

Is this not the case?

/Ramon



--
View this message in context: http://camel.465427.n5.nabble.com/Stream-Caching-when-uploading-a-binary-file-tp5743668p5743704.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Stream Caching when uploading a binary file

Posted by Claus Ibsen <cl...@gmail.com>.
You run out of memory when the file is loaded into memory,

java.lang.OutOfMemoryError: Java heap space]

How big is the file? And you could likely configure your JVM to have
more memory.


On Thu, Nov 21, 2013 at 11:54 PM, ramrubio <ra...@yahoo.com> wrote:
> Camel version = 2.12.1
>
> I'm using camel to implement an http proxy.  streamcache is enabled but when
> a client submits a http file upload request the following exception occurs.
>
> The proxy is working great for all other requests.  Does streamcache support
> binary file upload?  Is there any other configuration that needs to be done
> to enable binary file upload?  All other settings associated with
> streamcache are set to default values.
>
> Caused by: org.apache.camel.InvalidPayloadException: No body available of
> type: java.lang.String but has value:
> org.apache.camel.converter.stream.FileInputStreamCache@c6247a of type:
> org.apache.camel.converter.stream.FileInputStreamCache on: Message: [Body is
> instance of org.apache.camel.StreamCache]. Caused by: Error during type
> conversion from type: org.apache.camel.converter.stream.FileInputStreamCache
> to the required type: java.lang.String with value
> org.apache.camel.converter.stream.FileInputStreamCache@c6247a due
> java.lang.OutOfMemoryError: Java heap space. Exchange[Message: [Body is
> instance of org.apache.camel.StreamCache]]. Caused by:
> [org.apache.camel.TypeConversionException - Error during type conversion
> from type: org.apache.camel.converter.stream.FileInputStreamCache to the
> required type: java.lang.String with value
> org.apache.camel.converter.stream.FileInputStreamCache@c6247a due
> java.lang.OutOfMemoryError: Java heap space]
>         at
> org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:101)
>         at
> org.apache.camel.builder.ExpressionBuilder$38.evaluate(ExpressionBuilder.java:936)
>         ... 48 more
> Caused by: org.apache.camel.TypeConversionException: Error during type
> conversion from type: org.apache.camel.converter.stream.FileInputStreamCache
> to the required type: java.lang.String with value
> org.apache.camel.converter.stream.FileInputStreamCache@c6247a due
> java.lang.OutOfMemoryError: Java heap space
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:173)
>         at
> org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:99)
>         ... 49 more
> Caused by: org.apache.camel.RuntimeCamelException:
> java.lang.OutOfMemoryError: Java heap space
>         at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)
>         at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:986)
>         at
> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:275)
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:164)
>         ... 50 more
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Stream-Caching-when-uploading-a-binary-file-tp5743668.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen