MAC-XXL_JOB学习踩坑记录-Failed to create parent directories for [/data/applogs/xxl-job/xxl-job-admin.log

MAC-XXL_JOB学习踩坑记录

源码下载地址

①、GitHub:https://github.com/xuxueli/xxl-job
②、码云:https://gitee.com/xuxueli0323/xxl-job

启动报错

报错信息如下:

10:39:42,324 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file] - Failed to create parent directories for [/data/applogs/xxl-job/xxl-job-admin.log]
10:39:42,324 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file] - openFile(/data/applogs/xxl-job/xxl-job-admin.log,true) call failed. java.io.FileNotFoundException: /data/applogs/xxl-job/xxl-job-admin.log (No such file or directory)
	at java.io.FileNotFoundException: /data/applogs/xxl-job/xxl-job-admin.log (No such file or directory)
	at 	at java.io.FileOutputStream.open0(Native Method)
	at 	at java.io.FileOutputStream.open(FileOutputStream.java:270)
	at 	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
	at 	at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:26)
	at 	at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:204)
	at 	at ch.qos.logback.core.FileAppender.start(FileAppender.java:127)
	at 	at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:100)
	at 	at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
	at 	at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
	at 	at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
	at 	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
	at 	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
	at 	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
	at 	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at 	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at 	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
	at 	at org.apache.commons.logging.LogAdapter$Slf4jAdapter.createLocationAwareLog(LogAdapter.java:130)
	at 	at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:91)
	at 	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:67)
	at 	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:59)
	at 	at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:206)
	at 	at com.xxl.job.admin.XxlJobAdminApplication.main(XxlJobAdminApplication.java:13)
10:39:42,324 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
10:39:42,324 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [console] to Logger[ROOT]
10:39:42,324 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [file] to Logger[ROOT]
10:39:42,325 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
10:39:42,325 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@6e06451e - Registering current configuration as safe fallback point

Logging system failed to initialize using configuration from 'null'
java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file] - Failed to create parent directories for [/data/applogs/xxl-job/xxl-job-admin.log]
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file] - openFile(/data/applogs/xxl-job/xxl-job-admin.log,true) call failed. java.io.FileNotFoundException: /data/applogs/xxl-job/xxl-job-admin.log (No such file or directory)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:232)
	at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:73)
	at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
	at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:312)
	at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:281)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:375)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:333)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1340)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329)
	at com.xxl.job.admin.XxlJobAdminApplication.main(XxlJobAdminApplication.java:13)

大概意思是说初始化创建日志文件因权限不足!然后在网上的解决方案千篇一律为
在这里插入图片描述
但是,等我操作时,突然又提示父目录仅有只读权限,什么鬼

zhaoxiaofeng@zhaoxiaofengdeMacBook-Pro ~ % cd /
zhaoxiaofeng@zhaoxiaofengdeMacBook-Pro / % pwd     
/
zhaoxiaofeng@zhaoxiaofengdeMacBook-Pro / % sudo mkdir data
Password:
mkdir: data: Read-only file system
zhaoxiaofeng@zhaoxiaofengdeMacBook-Pro / % 

然后又是一通查找,果然又是千篇一律的要启动SPI等等,但是系统重启又会失效,因此这也不能本质解决问题。后来在在网友的评论中发现只需要在记录日志路径前加个‘.’就可以解决问题,如下:
/data/applogs/xxl-job/xxl-job-admin.log更换为./data/applogs/xxl-job/xxl-job-admin.log
果然问题解决,在这儿忍不住吐槽下CSDN的大多数的作者真的是越来越烂,只会照抄搬运。
不得不感叹下自古评论出大牛啊

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值