1
votes

I have a problem with CDI SessionScoped Bean. I have a controller which extends abstract controller. When I am trying to start application, occurs an error

WELD-001303: No active contexts for scope type javax.enterprise.context.SessionScoped.

@Named
@SessionScoped
public class UserController extends CatalogController implements    Serializable {

private static final long serialVersionUID = 5818789812426336142L;

public UserController() {
    super(User.class);
}}

public abstract class CatalogController<T> implements Serializable {

private static final long serialVersionUID = 2354059049000471596L;

@Inject
private CatalogService catalogService;

private Class<T> itemType; 

private Catalog newItem;

private Catalog selectedItem;

private List<Catalog> items;     

public CatalogController() {

} 

public CatalogController(Class<T> itemType) {
    this.itemType = itemType;
    newItemInstance();  
} 


@PostConstruct
public void init() {
    //items = catalogService.getAll();     
}

And here my service class.

public class CatalogService extends DataAccessService<Catalog> implements Serializable {

private static final long serialVersionUID = 5294530753916464146L;


public CatalogService() {
    super(Catalog.class);
}     
}
1

1 Answers

1
votes

I found a stange relationship between this error and glassfish server. After restarting the server this error dissapeare BUT when I am trying to change code for example in UserController the error occurs again.