自动装配NullPointerException

时间:2018-04-17 09:59:21

标签: java spring spring-boot spring-annotations

public class App extends SpringBootServletInitializer
{
   private static final Logger log = LoggerFactory.getLogger(App.class);
   @Autowired
    private static XsenseServicesImpl xsense;

    public static void main(String[] args) throws Exception {
      SpringApplication.run(App.class, args);
      log.debug("-- Application Started --");
      xsense.getFullAnswers("Ciao", "it", "84b4d0897df757df594cbc68",null,false, null);
   }
 }

为什么要给我这个错误?

  

线程中的异常" main" java.lang.NullPointerException App.main(App.java:39)

因为我确实在静态字段上设置了@Autowired?

0 个答案:

没有答案