java – WELD-000072声明钝化范围的托管bean必须具有钝化功能
作者:互联网
我在java Web表单中编写了一个简单的程序但是我收到以下错误:
WELD-000072 Managed bean declaring a passivating scope must be passivation capable. Bean: Managed Bean [class
BeanPakage.DemoBeans
] with qualifiers [@Any
@Default
@Named
]
谁能告诉我这个错误来自哪里?
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
@Named("DemoBeans")
@SessionScoped
public class DemoBeans {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
解决方法:
您可以通过实现Serializable接口来实现bean钝化:
public class DemoBean implements Serializable { ... }
请注意,对钝化能力有更多要求.有关更多信息,请参阅焊接文档.
标签:jboss-weld,java,cdi 来源: https://codeday.me/bug/20191003/1850549.html