Spring @Autowired not working on new thread
问题 When I run TaskJob I am getting null pointer exception because Spring doesn't autowiring serviceJob service. Is new thread causing this problem because Spring autowired mysqlService without any problem? public class TaskJob implements Runnable { @Autowired private ServiceJob serviceJob; String name; String source; public TaskJob(String name, String source) { this.name = name; this.source = source; } public void run() { serviceJob.run(); } } @Service public class ServiceJob extends BaseJob{