请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

application.yml 与老师提供的相同(ip地址相应调整,能ping通) logback-spring.xml 与老师提供的相同

2019-05-15 21:04:09,889 - Application startup failed
Exception in thread “main” java.lang.IllegalStateException: Logback configuration error detected:
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[fileInfoLog] - openFile(null,true) call failed. java.io.FileNotFoundException: D:\var\log\tomcat\sell\info.2019-05-15.log (拒绝访问。)
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[fileErrorLog] - openFile(null,true) call failed. java.io.FileNotFoundException: D:\var\log\tomcat\sell\error.2019-05-15.log (拒绝访问。)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:162)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:81)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:59)
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[fileInfoLog] - openFile(null,true) call failed. java.io.FileNotFoundException: D:\var\log\tomcat\sell\info.2019-05-15.log (拒绝访问。)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:115)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:303)
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[fileErrorLog] - openFile(null,true) call failed. java.io.FileNotFoundException: D:\var\log\tomcat\sell\error.2019-05-15.log (拒绝访问。)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:162)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:81)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:59)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:115)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:303)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:73)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:336)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at com.imooc.SellApplication.main(SellApplication.java:10)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:73)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:336)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.imooc.SellApplication.main(SellApplication.java:10)

Process finished with exit code 1

正在回答 回答被采纳积分+3

1回答

廖师兄 2019-05-15 23:32:05

D:\var\log\tomcat\sell\info.2019-05-15.log (拒绝访问。)

关于日志的路径

要先去建好这个目录 /var/log/tomcat/sell,否则会报错

Linux/Mac 下,还要给予可写权限

sudo chmod -R 777 /var/log/tomcat/sell


Windows下,路径格式类似

D:\var\log\tomcat\sell


0 回复 有任何疑惑可以回复我~
  • 提问者 cjozGV #1
    还是不行,在Windows下D:\var\log\tomcat\sell建了这个目录,路径也是D:\var\log\tomcat\sell,还是一样的错误
    回复 有任何疑惑可以回复我~ 2019-05-16 00:36:05
  • 廖师兄 回复 提问者 cjozGV #2
    我刚在win7下试了下。用java -jar 方式启动,都不需要提前建文件夹。我的windows没有d盘,所以填的是C:\var\log\tomcat\sell\info.%d.log,你把你的源码push到git, 发我链接看看
    回复 有任何疑惑可以回复我~ 2019-05-17 23:24:59
  • 提问者 cjozGV #3
    好了,应该是D盘权限不够,所以出现了拒绝的访问
    回复 有任何疑惑可以回复我~ 2019-05-17 23:27:36
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信