接上回书,成功连接上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提交代码时,不要提交上去。