“@inject”-ed attribute remains null
问题 I am trying to inject a service into my bean but it is always null . I get the following error: WELD-001000 Error resolving property userBean against base null. Some code snippets: index.xhtml <h:body> Hello from Facelets #{userBean.name} </h:body> userbean.java package beans; import Domain.User; import java.io.Serializable; import javax.enterprise.context.SessionScoped; import javax.inject.Inject; import javax.inject.Named; import service.UserService; @Named @SessionScoped public class