Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.io.NotSerializableException: org.apache.camel.component.file.GenericFile

I am trying to use a download logger that should log any kind of file transfer between two end points as defined below in camel-context.xml

        <process ref="downloadLogger"/>
        <to uri="file:src/main/resources/META-INF?noop=true"/>


        <!-- Prepare the message for calling OFBiz service -->
        <setHeader headerName="Ofbiz.ServiceName">
            <constant>DownLoadLogger</constant>
        </setHeader>
        <setHeader headerName="Ofbiz.Param.note">
            <simple>${in.body}</simple>
        </setHeader>

        <!-- Call the OFBiz service -->
        <camel:process ref="ofbizDispatcher"/>
    </camel:route>

But this gives rise to

java.io.NotSerializableException: org.apache.camel.component.file.GenericFile 
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1196)[camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.bean.BeanInvocation.invoke(BeanInvocation.java:87)[camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:128)[camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:73)[camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.rmi.RmiProducer.process(RmiProducer.java:45)[camel-rmi-2.9.0.jar:2.9.0]

I am using jdk 1.6 camel 2.9 jar. Please suggest if I am missing any configuration any where.

Thanks in advance

Padmalaya

like image 297
user1826397 Avatar asked Mar 05 '26 18:03

user1826397


1 Answers

Use following between 'from uri' and 'to uri'

<convertBodyTo type="byte[]"/>
like image 153
Amit Assudani Avatar answered Mar 08 '26 20:03

Amit Assudani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!