当quartz触发作业执行时,HoldService.unHold()方法抛出空指针异常。
public class SampleJob extends QuartzJobBean {
@Autowired
private HoldingService holdingService;
@Override
public void executeInternal(JobExecutionContext context) throws JobExecutionException {
holdingService.unHold();
}
}
服务
public interface HoldingService {
void unHold();
}
@Service("HoldingService")
@Scope("prototype")
public class HoldingServiceImpl implements HoldingService {
@Override
public void unHoldCycle() {}
}