0
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);
   }
 }

Why give me this error ?

Exception in thread "main" java.lang.NullPointerException App.main(App.java:39)

Because i did set @Autowired on static field?

Andrew Tobilko
  • 48,120
  • 14
  • 91
  • 142
user2462353
  • 57
  • 1
  • 10

0 Answers0