मैं इस Autowire के साथ एक परेशानी है के लिए autowire उम्मीदवार के रूप में उत्तीर्ण:स्प्रिंग की उम्मीद कम से कम 1 सेम जो इस निर्भरता
@Service @Transactional
public class ChiusuraProvider extends ThreadProvider {
public void run() {}
}
कि फैली
public abstract class ThreadProvider extends Thread implements InitializingBean, Runnable, DisposableBean {
...
}
: इस सेम के साथ
@Controller
public class ChiusuraController {
@Autowired
private ChiusuraProvider chiusuraProvider;
}
मुझे यह त्रुटि मिलती है:
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)}
मैंने देखा कि अगर मैं हटा देता हूं तो मुझे यह त्रुटि नहीं मिली है, तो ऑटोवॉयर क्लास के थ्रेडप्रोवाइडर को विस्तारित करता है, लेकिन मुझे वास्तव में थ्रेडप्रोवाइडर अमूर्त वर्ग की आवश्यकता है।
क्या होगा यदि मेरी कक्षा एकाधिक इंटरफ़ेस लागू करती है? – user1050619
रुको ... आपने बस अपना जीवन बचाया। मैंने एनोटेशन संस्करण @EnableAspectJAutoProxy (proxyTargetClass = true) का उपयोग किया। धन्यवाद! –