gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 03:22:01 32 4
gpt4 key购买 nike

我正在尝试使用一个下载记录器,它应该记录两个端点之间的任何类型的文件传输,如下面在 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>

但这会导致

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]

我正在使用 jdk 1.6 camel 2.9 jar。如果我在任何地方缺少任何配置,请提出建议。

提前致谢

莲花山

最佳答案

在“from uri”和“to uri”之间使用以下内容

<convertBodyTo type="byte[]"/>

关于apache - java.io.NotSerializableException : org. apache.camel.component.file.GenericFile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13396364/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com