问题原因: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. 【原创】大叔经验分享(4)Yarn ResourceManager页面如何实现主被自动切换

    hdfs.yarn.hbase这些组件的master支持多个,实现自动主备切换,其中hdfs.hbase无论访问主master或者备master都可以正常访问页面,但是yarn比较特别,只有主mast ...

  2. apache安装软负载的配置说明

    安装Apache:yum -y install httpd 首先要查看apache的安装版本 命令:httpd –v 第一种: 若安装是2.2版本,则把复制 mod_wl_22.so和mod_wl.s ...

  3. C++中几个输入函数的用法和区别(cin、cin.get()、cin.getline()、getline()、gets()、getchar())

    1.cin>> 用法1:最基本,也是最常用的用法,输入一个数字: #include <iostream>using namespace std;main (){int a,b; ...

  4. 如何连接LINUX服务器

    1.WINDOW下连接 使用PUTTY连接,链接如下:https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html 下载安装后打开,运行 ...

  5. df -h hang 问题

    此处仅截取原文中的解决方案,以便快速查找解决方法. 解决方法如下:1. systemctl restart proc-sys-fs-binfmt_misc.automount; 2. 升级到最新 sy ...

  6. matplotlib图例-【老鱼学matplotlib】

    图例是啥,直接上图就知道了: 怎么创建上面的图例呢? 很简单,首先在plt.plot()函数中设置label文本属性,然后调用plt.legend()生成图例就可以了,完整的代码如下: import ...

  7. 关闭 Window 之后,无法设置 Visibility,也无法调用 Show、ShowDialogor 或 WindowInteropHelper.EnsureHandle。

    参考网址: 1.WPF Tips: Window.ShowDialog()方法:Cannot set Visibility or call Show, ShowDialog, or WindowInt ...

  8. ELK对Tomcat日志双管齐下-告警触发/Kibana日志展示

    今天我们来聊一聊Tomcat,相信大家并不陌生,tomcat是一个免费开源的web应用服务器,属于轻量级的应用程序,在小型生产环境和并发不是很高的场景下被普遍使用,同时也是开发测试JSP程序的首选.也 ...

  9. 前端技术之--HTML

    1.一套规则,浏览器认识的规则. 2.开发者: 学习Html规则 开发后台程序: - 写Html文件(充当模板的作用) ****** - 数据库获取数据,然后替换到html文件的指定位置(Web框架) ...

  10. Class--2019-04-14

    获取class对象,有三种方法: 1.通过类名.class直接访问 Class c = Integer.class; 2.通过Class.forName(类名)函数获取 Class c = Class ...