Why is my @Autowired object null?
问题 I've the below JSF managed bean: package com.example; import java.io.Serializable; import javax.faces.bean.ManagedBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component @ManagedBean public class Bean implements Serializable { @Autowired private SomeService someService; public void update() { someService.update(someEntity); } // ... } And the below Spring service: @Transactional @Repository public class SomeService {