{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3209","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3209/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3209/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3209/events","html_url":"https://github.com/spring-projects/spring-boot/issues/3209","id":87494066,"number":3209,"title":"Multipart property gives error when enabled","user":{"login":"ofbizbrazil","id":6670361,"avatar_url":"https://avatars.githubusercontent.com/u/6670361?v=3","gravatar_id":"","url":"https://api.github.com/users/ofbizbrazil","html_url":"https://github.com/ofbizbrazil","followers_url":"https://api.github.com/users/ofbizbrazil/followers","following_url":"https://api.github.com/users/ofbizbrazil/following{/other_user}","gists_url":"https://api.github.com/users/ofbizbrazil/gists{/gist_id}","starred_url":"https://api.github.com/users/ofbizbrazil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofbizbrazil/subscriptions","organizations_url":"https://api.github.com/users/ofbizbrazil/orgs","repos_url":"https://api.github.com/users/ofbizbrazil/repos","events_url":"https://api.github.com/users/ofbizbrazil/events{/privacy}","received_events_url":"https://api.github.com/users/ofbizbrazil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/in%20progress","name":"in progress","color":"eac04b"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/spring-projects/spring-boot/milestones/41","html_url":"https://github.com/spring-projects/spring-boot/milestones/1.2.5","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/milestones/41/labels","id":1146043,"number":41,"title":"1.2.5","description":"","creator":{"login":"philwebb","id":519772,"avatar_url":"https://avatars.githubusercontent.com/u/519772?v=3","gravatar_id":"","url":"https://api.github.com/users/philwebb","html_url":"https://github.com/philwebb","followers_url":"https://api.github.com/users/philwebb/followers","following_url":"https://api.github.com/users/philwebb/following{/other_user}","gists_url":"https://api.github.com/users/philwebb/gists{/gist_id}","starred_url":"https://api.github.com/users/philwebb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwebb/subscriptions","organizations_url":"https://api.github.com/users/philwebb/orgs","repos_url":"https://api.github.com/users/philwebb/repos","events_url":"https://api.github.com/users/philwebb/events{/privacy}","received_events_url":"https://api.github.com/users/philwebb/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":19,"state":"open","created_at":"2015-06-02T20:49:59Z","updated_at":"2015-06-15T18:45:04Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-06-11T20:56:35Z","updated_at":"2015-06-15T18:45:04Z","closed_at":"2015-06-15T18:45:04Z","body":"Hi,\r\n\r\nWhen the property `multipart.enabled=true` is enabled, throws an exception on console saying it has an invalid value. You can notice in the following link http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html, it should work normally. \r\n\r\n```\r\nCaused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'enabled' of bean class [org.springframework.boot.autoconfigure.web.MultipartProperties]: Bean property 'enabled' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?\r\n    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1076)\r\n    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:927)\r\n    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)\r\n    at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:749)\r\n    at org.springframework.validation.DataBinder.doBind(DataBinder.java:645)\r\n    at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:121)\r\n    at org.springframework.validation.DataBinder.bind(DataBinder.java:630)\r\n    at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:253)\r\n    at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:227)\r\n    at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:296)\r\n    ... 73 common frames omitted\r\n```\r\n\r\n```\r\n# MULTIPART (MultipartProperties)\r\nmultipart.enabled=true\r\nmultipart.file-size-threshold=0 # Threshold after which files will be written to disk.\r\nmultipart.location= # Intermediate location of uploaded files.\r\nmultipart.max-file-size=1Mb # Max file size.\r\nmultipart.max-request-size=10Mb # Max request size.\r\n```\r\n\r\nSo to dodge this issue, I had to add via Java configuration one filter enabling the Multipart in Spring Boot:\r\n\r\n```\r\n@Configuration\r\n    public class TestConfig {\r\n\r\n        @Bean\r\n        public FilterRegistrationBean openEntityManagerFilterRegistrationBean() {\r\n            // Set upload filter\r\n            final MultipartFilter multipartFilter = new MultipartFilter();\r\n            final FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(multipartFilter);\r\n            filterRegistrationBean.addInitParameter(\"multipartResolverBeanName\", \"commonsMultipartResolver\");\r\n\r\n            return filterRegistrationBean;\r\n        }\r\n\r\n        @Bean\r\n        public CommonsMultipartResolver commonsMultipartResolver() {\r\n            final CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();\r\n            commonsMultipartResolver.setMaxUploadSize(-1);\r\n\r\n            return commonsMultipartResolver;\r\n        }\r\n    }\r\n```"}}