使用getFile上传文件报错java.lang.IllegalArgument

使用getFile上传文件时报错java.lang.IllegalArgumentException: Not writable: /data/server/crm/crm-data/upload/20200629,图上指定的文件夹是存在的
具体报错内容如下:
java.lang.IllegalArgumentException: Not writable: /data/server/crm/crm-data/upload/20200629
    at com.oreilly.servlet.MultipartRequest.parse(MultipartRequest.java:234)
    at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:180)
    at com.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:107)
    at com.jfinal.upload.MultipartRequest.<init>(MultipartRequest.java:63)
    at com.jfinal.core.Controller.getFiles(Controller.java:846)
    at com.jfinal.core.Controller.getFile(Controller.java:851)
    at com.kakarote.crm9.erp.admin.controller.AdminFileController.upload(AdminFileController.java:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:97)
    at com.kakarote.crm9.erp.admin.common.AdminInterceptor.intercept(AdminInterceptor.java:9)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
    at com.kakarote.crm9.common.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:39)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
    at com.kakarote.crm9.common.interceptor.ErpInterceptor.intercept(ErpInterceptor.java:57)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
    at com.jfinal.core.ActionHandler.handle(ActionHandler.java:90)
    at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:46)
    at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)
    at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

评论区

zzutligang

2020-06-29 18:18

是不是说那个文件夹没有写权限?看看那个文件夹的授权信息。是否当前登录用户可写。

JFinal

2020-06-29 19:56

出现这个异常:java.lang.IllegalArgumentException: Not writable

证明是与 jfinal 无关的,确保这个目录有 "写" 权限

smileForLife

2020-06-30 10:37

@JFinal 谢谢波总,确实是权限问题

smileForLife

2020-06-30 10:37

@zzutligang 确实是权限问题,谢谢