首先,您应该在Abstract SIIMPL类中使用不使用通配符的泛型。这样看起来像:
public abstract class SIIMPL<T> { protected I<T> foo; // Don't autowire here}然后如上所述,不要将泛型I对象自动连接到抽象类中,只需在那里定义它,然后通过构造函数注入将其自动连接到您的具体类中:
public class SI1IMPL extends SIIMPL<M1> implements ST1 { public ST1IMPL(@Autowired I<M1> foo) { this.foo = foo; }}


