从linux中的systemd服务运行spring boot jar时出错

时间:2019-04-02 04:43:43

标签: spring-boot corda

嗨,我收到此错误:

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498) org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
main ERROR Null object returned for RollingFile in Appenders.
main ERROR Unable to locate appender "RollingFile-Appender" for logger config "root"
main ERROR Unable to locate appender "RollingFile-Appender" for logger config "net.corda"

服务文件:

[Unit] Description=Webserver for Corda Node - Notary Requires=network.target [Service] Type=simple User=corda WorkingDirectory=/opt/corda/Notary ExecStart=/usr/bin/java -jar /opt/corda/Notary/corda-webserver.jar Restart=on-failure [Install] WantedBy=multi-user.target 

2 个答案:

答案 0 :(得分:0)

您的log4j2.xml配置正在尝试使用尚未定义的附加程序(RollingFile-Appender)。将此添加到log4j2.xml,它应该可以工作。

答案 1 :(得分:0)

它已经被添加,必须有其他原因