问题原因:springboot创建临时文件找不到对应的目录

解决办法:1. 重新指定临时文件位置  java -Djava.io.tempdir=D:/tmpdir -jar -my_project.jar

     2. 手动创建指定文件夹

     3. 启动类中加入配置临时文件目录

    

   @Bean
MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
String location = System.getProperty("user.dir") + "/data/tmp";
File tmpFile = new File(location);
if (!tmpFile.exists()) {
tmpFile.mkdirs();
}
factory.setLocation(location);
return factory.createMultipartConfig();
}

  

org.springframework.boot.web.server.WebServerException: Unable to create tempDir. java.io.tmpdir is set to C:\Users\ADMINI~1\AppData\Local\Temp\2\的更多相关文章

  1. SpringCloud Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded

    出现此问题,有可能是spring cloud 与spring boot 版本不匹配引发的问题,此次用的版本是:Finchley.RC1 经过一番关键字查找,发现spring cloud 与spring ...

  2. SpringBoot项目 org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Jetty servlet container报错

    SpringBoot项目启动报错 ERROR 2172 --- [ main] o.s.boot.SpringApplication : Application startup failed org. ...

  3. 被“org.springframework.boot.web.support.SpringBootServletInitializer;”耽搁的两天

    org.springframework.boot.web.support.SpringBootServletInitializer 改为: org.springframework.boot.conte ...

  4. SpringBoot从1.5.1→2.2.4项目加包扫雷一:Error:(8, 44) java: 程序包org.springframework.boot.web.support不存在

    更换成新包即可import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

  5. spring boot 开发 org.springframework.context.ApplicationContextException: Unable to start web server;

    Error starting ApplicationContext. To display the conditions report re-run your application with 'de ...

  6. Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

    SpringBoot启动时的异常信息如下: "C:\Program Files\Java\jdk1.8.0_161\bin\java" ......... com.fangxing ...

  7. 【转载】springboot启动报错(Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWe)

    SpringBoot启动时的异常信息如下: 1 "C:\Program Files\Java\jdk1.8.0_161\bin\java" ......... com.fangxi ...

  8. org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplic

    org.springframework.context.ApplicationContextException: Unable to start web server; nested exceptio ...

  9. SpringBoot从1.5.1→2.2.4项目加包扫雷二:打不到符号java: org.springframework.boot.autoconfigure.web.相关配置错误支持包

    import org.springframework.boot.autoconfigure.web.DefaultErrorAttributes→org.springframework.boot.we ...

随机推荐

  1. numpy数据去重

    import numpy as npx = np.array([1,2,3,2,4,2,5,7,7])print(np.unique(x)) 简单散点图的绘制,没有显示出文字是因为需要下载个插件

  2. 集腋成裘-08-ECharts -简介-01

    目标:让数据说话. 大数据时代的到来以及有效应用,大幅度提升了企业的管理能力.决策科学化与可执行性水平,推动传统决策方式朝着数据驱动转型.可视化数据分析对决策者产生的意义将在事前预测.事中感知以及事后 ...

  3. sklearn标准化-【老鱼学sklearn】

    在前面的一篇博文中关于计算房价中我们也大致提到了标准化的概念,也就是比如对于影响房价的参数中有面积和户型,面积的取值范围可以很广,它可以从0-500平米,而户型一般也就1-5. 标准化就是要把这两种参 ...

  4. 整理一下python中with的用法

    ith替代了之前在python里使用try...finally来做清理工作的方法.基本形式如下: with expression [as variable]: with-block 当expressi ...

  5. nginx 错误502 upstream sent too big header while reading response header from upstream

    查看nginx的错误日志,得到以下错误信息:upstream sent too big header while reading response header from upstream按字面意思理 ...

  6. Linq 动态组合排序(Lambda)

    最近有个项目需要做一个排班的功能,需要对排班的数据按不同的规则进行排序:因为排序规则是动态变化的,所以不太适合放到数据库中(临时表)中处理: 所以考虑使用Linq的排序方式(按不同的条件判断条件组合排 ...

  7. C#创建ActiveX

    因为最近的项目可能会用到调用外部设备,读取信息.为了和现有的BS系统兼容,并以较小的代价满足需求,于是想到了使用ActiveX技术(也有人建议使用Silverlight),这技术虽然比较早了,但还是能 ...

  8. Linux 安装zookeeper

    分享到:   1.下载zokeeper 1.1 官网下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/ 1.2 链接:https:/ ...

  9. 做rl_abs过程中遇到的问题

    问题一 运行 train_abstractor.py就出现这个问题 nohup: ignoring input start training with the following hyper-para ...

  10. mysql学习1

    1.什么是数据库? 数据的仓库,如在ATM的示例中创建了一个db目录,称其为数据库 2.安装 下载 http://dev.mysql.com/downloads/mysql/ 安装 windows: ...