Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/399.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring集成http上载文件_Java_Spring_Spring Mvc_Spring Integration_Multipart - Fatal编程技术网

Java Spring集成http上载文件

Java Spring集成http上载文件,java,spring,spring-mvc,spring-integration,multipart,Java,Spring,Spring Mvc,Spring Integration,Multipart,我已经写了一个代码来上传图片到我的服务器上。我已经用SpringIntegration编写了这段代码,但是当我尝试将multipartfile恢复到服务中时,我遇到了这个错误 Caused by: java.lang.IllegalStateException: File has been moved - cannot be read again at org.springframework.web.multipart.commons.CommonsMultipartFile.getIn

我已经写了一个代码来上传图片到我的服务器上。我已经用SpringIntegration编写了这段代码,但是当我尝试将multipartfile恢复到服务中时,我遇到了这个错误

Caused by: java.lang.IllegalStateException: File has been moved - cannot be read again
    at org.springframework.web.multipart.commons.CommonsMultipartFile.getInputStream(CommonsMultipartFile.java:123)
我有一个控制器,它填充一个模型(文件和描述),然后通过消息通道将其发送到一个服务以处理图像。这是我的集成上下文的一部分

<channel id="photoProcessingChannel">
        <queue />
    </channel>
    <outbound-channel-adapter channel="photoProcessingChannel" method="processingBufferphoto" ref="BufferphotoService">
        <poller fixed-rate="2000"/>
    </outbound-channel-adapter>


有什么建议吗?

这个示例对您没有帮助吗?我的情况不同,我想通过controller上传文件,并将其发送到服务以保存到DBWell,我想您应该将
多部分文件
转换为
字节[]
,在
@controller
中只发送到
频道