xxl-job-executor-sample-jboot如何设置jboot参数
xuyingpeng opened this issue · 1 comments
xuyingpeng commented
public class JbootApp {
public static void main(String[] args) {
//mysql
JbootApplication.setBootArg("jboot.datasource.type", Jboot.configValue("jboot.datasource.type"));
JbootApplication.setBootArg("jboot.datasource.url", Jboot.configValue("jboot.datasource.url"));
....
JbootApplication.run(args);
}
}
执行时出现以下错误:
Exception in thread "main" java.lang.NullPointerException
at io.jboot.app.config.JbootConfigManager.setBootArg(JbootConfigManager.java:351)
at io.jboot.app.JbootApplication.setBootArg(JbootApplication.java:164)
at com.adsage.jobs.JbootApp.main(JbootApp.java:12)
yangfuhai commented
JbootApplication.setBootArg("jboot.datasource.type", “xxxx”) ; 中的 xxxx 直接写死,不能通过 Jboot.configValue("jboot.datasource.type" 去获取。