Spring service调用问题

TDsfly TDsfly 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
public class MailTask extends TimerTask {
private static boolean isRunning = false;
@Autowired
KPIManager kpiManager;
@SuppressWarnings("deprecation")
public void run() {
if (!isRunning) {
System.out.println("My Mailtask starting....................");
try {
//reciever list
Map<String, RecType> receiver = new LinkedHashMap<String, RecType>();
RecType recType = RecType.t;
//test-Theodore
String receiverId="xxxxxxxxxx";
receiver.put(receiverId, recType);
String sender="yyyyyyyyyyyyyy";
MsgType msgType = MsgType.official;

Date date = new Date();
Calendar cal = new GregorianCalendar();
cal.setFirstDayOfWeek(Calendar.MONDAY);
cal.setMinimalDaysInFirstWeek(7);
cal.setTime (date);
String year="";
String week="";
year=String.valueOf(cal.get(Calendar.YEAR));
week= String.valueOf(cal.get(Calendar.WEEK_OF_YEAR));
System.out.println("*******************");
System.out.println(year);
System.out.println(week);
System.out.println("*******************" + kpiManager);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
请教下,为什么系统启动后,无法加载kpiManager,输出总是null,进而无法使用kpiManager方法?
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
TDsfly
Web 开发 81,108 成员 341,721 内容