Linux普通用户(非root用户)启动程序,poi导入导出报错解决

当公司项目从root用户切换到普通用户启动时,出现了poi导入导出功能报错的问题。报错原因在于Linux服务器清理了/tmp目录,导致poi依赖的临时目录/tmp/poifiles被删除,造成权限不足。解决方法是作为root用户,将临时目录/tmp/poifiles设置为所有用户可读写,从而避免权限问题。
摘要由CSDN通过智能技术生成

一、问题描述:公司项目原先都是root用户启动,导入导出功能都正常,后因运维交付甲方,甲方用普通用户启动项目后,导入导出报错,报错信息如下:

10:30:21.509 [http-nio-9202-exec-5] ERROR c.r.c.c.u.p.ExcelUtil - [exportExcel,384] - 导出Excel异常java.io.IOException: Permission denied
10:30:28.013 [http-nio-9202-exec-9] ERROR c.r.c.s.h.GlobalExceptionHandler - [handleException,83] - java.io.IOException: Permission denied
java.lang.RuntimeException: java.io.IOException: Permission denied
        at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:662)
        at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:650)
        at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:90)
        at com.ruoyi.gen.controller.LaTagValueController.exportAll(LaTagValueController.java:94)
        at com.ruoyi.gen.controller.LaTagValueController$$FastClassBySpringCGLIB$$b62e855d.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
        at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:55)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
        at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
        at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值