weikuang5806
2017-10-13 13:07 阅读 1.3k

【急、高分】spring boot 集成quartz 自动注入bean为null

public class OrderJob implements BaseJob {

@Autowired
@Qualifier("schedulerFactoryBean")
private JobController jobController;
private static Logger _log = LoggerFactory.getLogger(OrderJob.class);

@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
    if (jobController != null) {
        String jobClassName = "";
        String jobGroupName = "";

// try {
// jobController.deletejob(jobClassName, jobGroupName);
// } catch (Exception ex) {
// java.util.logging.Logger.getLogger(OrderJob.class.getName()).log(Level.SEVERE, null, ex);
// }
} else {
System.out.println("jobController:" + jobController);
}
_log.error("OrderJob 执行时间:" + new Date());
}

}

老是输出为null。。
以下为我写的demo,好心淫 帮忙看看必有重分
链接:http://pan.baidu.com/s/1pLFm9XT 密码:rnrr

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

相关推荐