摘要: https://stackoverflow.com/questions/10087989/how-do-i-reflectively-invoke-a-method-with-null-as-argument method.invoke(object,new Object[]{ null }); 阅读全文
posted @ 2017-08-28 16:39 每天一点积累 阅读(629) 评论(0) 推荐(0) 编辑
摘要: 什么情况下才能用autowired? 当当前类属于spring IOC容器管时候就可以,比如在applicationContext.xml里有定义 就是说在spring上下文里能够找到 但是比如quartz job是quartz自己实例化,所以当下面这么做会报null pointer 这时只要加一句 阅读全文
posted @ 2017-08-28 15:31 每天一点积累 阅读(731) 评论(0) 推荐(0) 编辑
摘要: 主要参考: https://www.ibm.com/developerworks/cn/java/j-lo-springunitest/ http://www.cnblogs.com/rainisic/archive/2012/01/22/Spring_Test_Framework.html mav 阅读全文
posted @ 2017-08-28 11:50 每天一点积累 阅读(180) 评论(0) 推荐(0) 编辑