“Unable to create the directory [XXX] to use as the base directory”的解决办法

接上回书,成功连接上vPiEn后,down代码,起代码……额,在起代码时又出现了问题。

问题

主要是这几句:
Unable to start web server;
nested exception is java.lang.IllegalStateException:
Unable to create the directory [/Users/liming/Downloads/logs/tomcat_log] to use as the base directory

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-04-12 10:24:37,648 [ERROR] [main] [org.springframework.boot.SpringApplication] - Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: Unable to create the directory [/Users/liming/Downloads/logs/tomcat_log] to use as the base directory
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at com.yhdx.agbweapp.WeappApplication.main(WeappApplication.java:96) [classes/:na]
Caused by: java.lang.IllegalStateException: Unable to create the directory [/Users/liming/Downloads/logs/tomcat_log] to use as the base directory
	at org.apache.catalina.startup.Tomcat.initBaseDir(Tomcat.java:816) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.startup.Tomcat.getServer(Tomcat.java:625) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.startup.Tomcat.getService(Tomcat.java:558) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:169) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	... 8 common frames omitted
原因

自己电脑是没有这个目录的,也或许是因为SIP安全机制,idea也没有办法在电脑上创建个此目录,所以报错了。解决办法就是找个已存在的目录即可。

解决

全局搜“/Users/liming/Downloads”,找到dev环境的配置文件,将“liming”改为自己的电脑用户名就可以啦

比如我的改为“/Users/wangziyue/Downloads”就能运行成功啦。不过要注意,git提交代码时,不要提交上去。

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卡夫卡的熊kfk

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值