java junit测试quartz job报错

java junit测试quartz job报错原因

Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:216)


因为,job是一个线程,junit线程结束了,job线程还在运行,导致了job获取不到一些bean;

解决:

junit线程sleep一段时间,足够job去启动测试。


你可能感兴趣的:(Java,Basic)