我最近将Netbeans和java升级到了最新版本,并且出现了以下错误。当我运行我的应用程序时它工作正常。但是当我刷新调用下面显示的类的Prmefaces屏幕时,我得到以下错误。我在这里已经回顾了几个类似的问题,但似乎都没有澄清我的问题。
致命:JSF1073:org.jboss.weld.context.ContextNotActiveException在处理RENDER_RESPONSE 6时被捕获:UIComponent-ClientId =,Message = WELD-001303:没有活动上下文,范围类型为javax.enterprise.context.SessionScoped 致命:WELD-001303:范围类型javax.enterprise.context.SessionScoped没有活动的上下文
@Named @SessionScoped 公共类MainController实现Serializable {
private static final long serialVersionUID = 1L;
private List<String> selectedBrands;
private List<SelectItem> brandCategories;
public MainController()
{
selectedBrands = new ArrayList<>();
brandCategories = new ArrayList<>();
}
public List<SelectItem> getBrandCategories()
{
brandCategories.clear();
SelectItemGroup brand = new SelectItemGroup("");
brand.setSelectItems(new SelectItem[]
{
new SelectItem(Messages.ELECTROLUX, Messages.ELECTROLUX),
new SelectItem(Messages.LG, Messages.LG),
new SelectItem(Messages.WHIRLPOOL, Messages.WHIRLPOOL),
new SelectItem(Messages.FRIGIDAIRE, Messages.FRIGIDAIRE)
});
brandCategories.add(brand);
return brandCategories;
}
}