このAutowireに問題があります:
@Controller
public class ChiusuraController {
@Autowired
private ChiusuraProvider chiusuraProvider;
}
この豆で:
@Service @Transactional
public class ChiusuraProvider extends ThreadProvider {
public void run() {}
}
伸びる
public abstract class ThreadProvider extends Thread implements InitializingBean, Runnable, DisposableBean {
...
}
このエラーが発生します:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chiusuraController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.cinebot.service.ChiusuraProvider com.cinebot.web.controller.ChiusuraController.chiusuraProvider; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.cinebot.service.ChiusuraProvider] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
自動配線クラスのextendsThreadProviderを削除してもこのエラーが発生しないことを 確認しまし たが、実際にはThreadProvider抽象クラスが必要です。