当前位置: 首页 > 工具软件 > Weld > 使用案例 >

Caused by: org.jboss.weld.exceptions.DefinitionException:WELD-000075:Normal scoped managed bean impl

濮阳默
2023-12-01
WELD-000075: Normal scoped managed bean implementation class has a public field:
[EnhancedAnnotatedFieldImpl] public nis.spro.seisan.domain.master.mente.shodonjoken2.SczsprnwServiceImpl.fc
com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.exception.RuntimeError: com.ibm.ws.exception.RuntimeError:
java.lang.RuntimeException: com.ibm.ws.cdi.CDIRuntimeException: com.ibm.ws.cdi.CDIDeploymentRuntimeException: org.jboss.weld.exceptions.DefinitionException:
WELD-000075: Normal scoped managed bean implementation class has a public field:
[EnhancedAnnotatedFieldImpl] public nis.spro.seisan.domain.master.mente.shodonjoken2.SczsprnwServiceImpl.fc

普通作用域的托管bean实现类有一个public字段
[增强注释字段]
public FlowControlImpl fc = new FlowControlImpl();
If a managed bean has a public field, it must have scope @Dependent.
If a managed bean with a public field declares any scope other than @Dependent,
the container automatically detects the problem and treats it as a definition error.
如果托管bean有一个public字段,那么它的作用域(范围Scope)必须用’@Dependent’注解。
如果带有public字段(属性)的托管bean声明了除@Dependent以外的任何作用域,则容器会自动检测问题并将其视为’定义错误’。
解决办法: 把’@RequestScope’换成’@Dependent’

常用注解有:
包路径javax.enterprise.context.
@RequestScoped @SessionScope @ApplicationScoped @Dependent

参考:https://codingdict.com/sources/java/javax.enterprise.context.html

 类似资料:

相关阅读

相关文章

相关问答