Java.lang.IllegalStateException:File have been moved-cannot be read again

Source: Internet
Author: User

In the Jqueryfileupload upload file times the following error:

Java.lang.IllegalStateException:File have been moved-cannot be read again

The background interface is Spring MVC, which examines the Sprnig MVC configuration file:

<bean id= "Multipartresolver" class= "Org.springframework.web.multipart.commons.CommonsMultipartResolver" > <property name= "Maxuploadsize" ><value>102400000</value></property></bean>
You have configured the maximum size allowed to upload files, and the size of your uploaded files is much smaller than this, what is the case?

After searching the data online, we found that spring MVC, in addition to the Maxuploadsize parameter, has a maxinmemorysize parameter that specifies the maximum number of Szie to allow the file to be written to memory. The default is 1024 bytes, that is, 1MB, if you try to upload a file larger than 1024 bytes, you need to increase the maxinmemorysize price.

As follows:

<beans xmlns= "Http://www.springframework.org/schema/beans" xmlns:xsi= "http://www.w3.org/2001/ Xmlschema-instance "xmlns:p=" http://www.springframework.org/schema/p "xmlns:context="/HTTP/ Www.springframework.org/schema/context "xsi:schemalocation=" Http://www.springframework.org/schema/beans/http           Www.springframework.org/schema/beans/spring-beans-4.0.xsd Http://www.springframework.org/schema/context Http://www.springframework.org/schema/context/spring-context-4.0.xsd "><!--Add interceptors--><bean id=" Handlermapping "class=" org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping ">< Property name= "Interceptors" ><bean class= "Com.message.web.interceptor.SessionInterceptor"/></ property></bean> <!--Configuring the Controller scan--><context:component-scan base-package= " Com.message.web.controller "/><!--configuration Springmvc View resolver--><bean class=" Org.springframework.web.servlet.view.InternalResourceViewResolver "><propeRty name= "Viewclass" ><value>org.springframework.web.servlet.view.jstlview</value></property ><property name= "prefix" ><value>/message/</value></property><property name= "suffix "><value>.jsp</value></property></bean><!--set the maximum size of the uploaded file to 100MB--><bean id=" Multipartresolver "class=" Org.springframework.web.multipart.commons.CommonsMultipartResolver "><property Name= "Maxuploadsize" ><value>102400000</value></property><property name= "maxInMemorySize   "><value>10240000</value></property></bean></beans>


Java.lang.IllegalStateException:File have been moved-cannot be read again

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.