项目启动一段时间后,上传文件报错,centos7

Blade 已结 1 1349
312237823
312237823 剑圣 2020-11-11 15:47

一、该问题的重现步骤是什么?

1. 项目启动一切正常,使用一段时间后,会出现上传文件报错,错误信息大概是临时目录找不到,

2. 重启Jar包,一切正常,过段时间,又重演一次问题,

3.在网上查的,都是说临时目录被系统清理了


二、你期待的结果是什么?实际看到的又是什么?

有什么办法通过配置文件修改一下临时目录???

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladex2.2 centos7

四、请提供详细的错误堆栈信息,这很重要。

java.lang.RuntimeException: java.nio.file.NoSuchFileException: /tmp/undertow.4087938622883476569.8081/undertow929975180065862920upload
	at io.undertow.server.handlers.form.MultiPartParserDefinition$MultiPartUploadHandler.beginPart(MultiPartParserDefinition.java:261) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.util.MultipartParser$ParseState.headerName(MultipartParser.java:208) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.util.MultipartParser$ParseState.parse(MultipartParser.java:123) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.server.handlers.form.MultiPartParserDefinition$MultiPartUploadHandler.parseBlocking(MultiPartParserDefinition.java:232) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.spec.HttpServletRequestImpl.parseFormData(HttpServletRequestImpl.java:835) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.spec.HttpServletRequestImpl.getParameter(HttpServletRequestImpl.java:714) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:85) ~[spring-web-5.1.10.RELEASE.jar!/:5.1.10.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.10.RELEASE.jar!/:5.1.10.RELEASE]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.1.10.RELEASE.jar!/:5.1.10.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.10.RELEASE.jar!/:5.1.10.RELEASE]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) [undertow-servlet-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376) [undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) [undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_102]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
Caused by: java.nio.file.NoSuchFileException: /tmp/undertow.4087938622883476569.8081/undertow929975180065862920upload
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) ~[na:1.8.0_102]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_102]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_102]
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[na:1.8.0_102]
	at java.nio.file.Files.newByteChannel(Files.java:361) ~[na:1.8.0_102]
	at java.nio.file.Files.createFile(Files.java:632) ~[na:1.8.0_102]
	at java.nio.file.TempFileHelper.create(TempFileHelper.java:138) ~[na:1.8.0_102]
	at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:161) ~[na:1.8.0_102]
	at java.nio.file.Files.createTempFile(Files.java:852) ~[na:1.8.0_102]
	at io.undertow.server.handlers.form.MultiPartParserDefinition$MultiPartUploadHandler.beginPart(MultiPartParserDefinition.java:254) ~[undertow-core-2.0.26.Final.jar!/:2.0.26.Final]
	... 42 common frames omitted
1条回答
  •  zhx1994
    zhx1994 (最佳回答者)
    2020-11-11 17:54

    https://www.zhangbj.com/p/474.html

    0 讨论(1)
提交回复