package org.easyworld.function.user.userIndex.action;import java.util.List;
import java.util.Map;
import org.easyworld.function.user.userIndex.service.UserIndexService;public class MyThread extends Thread {

private UserIndexService userIndexService;

public UserIndexService getUserIndexService() {
return userIndexService;
}
public void setUserIndexService(UserIndexService userIndexService) {
this.userIndexService = userIndexService;
}
public void run(){

while(!this.isInterrupted()){
try{
Thread.sleep(30000);
}catch(InterruptedException e){
 e.printStackTrace(); 
}
//此处空指针
Map<String,Object> map = userIndexService.checkGoods();
                               //如果单独输出aaa 则是正常的
                                //System.out.println("aaa");
  }
}

}
Service 里面
public Map<String,Object> checkGoods(){
Map<String,Object> map = new HashMap<String, Object>();
List<Map<String, Object>> list  = queryForList("userIndex.check_goods");
map.put("list", list);
return map;
}异常
Exception in thread "Thread-4" java.lang.NullPointerException
at org.easyworld.function.user.userIndex.action.MyThread.run(MyThread.java:26)
 求大神帮看看出错的地方在哪  可能是Spring的注入有问题,但是同一个包下别的类中 注入是正常的
线程异常