有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

迁移到Jboss EAP7时出现java焊接异常

从EAP 6.4.9迁移到JBOSS EAP 7.3时,我面临以下异常

ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 72) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "xxx.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"xxx.war\".WeldStartService" => "Failed to start service Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000805: Cannot have more than one post construct method annotated with @PostConstruct for [EnhancedAnnotatedTypeImpl] public @ManagedBean class com.xxxx.xxxx.SampleManagedBean"}} ERROR [org.jboss.as.server] (ServerService Thread Pool -- 72) WFLYSRV0021: Deploy of deployment "xxxx.war" was rolled back with the following failure message: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"xxxx.war\".WeldStartService" => "Failed to start service Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000805: Cannot have more than one post construct method annotated with @PostConstruct for [EnhancedAnnotatedTypeImpl] public @ManagedBean class com.xxxx.xxxxx.SampleManagedBean"}}

它在EAP6中运行良好。4.该问题发生在EAP 7及以上版本中。 任何关于这方面的建议都会帮上大忙。 提前谢谢


共 (1) 个答案

  1. # 1 楼答案

    The javadoc for ^{}指定:

    Only one method can be annotated with this annotation

    错误日志显示JBoss EAP 7.3抱怨com.xxxx.xxxx.SampleManagedBean类有多个这样的方法。我建议在这个类中创建一个新方法@PostConstruct,它将调用另外两个方法,注释应该从中删除

    这不是JBoss EAP 7.3的bug,我怀疑您能否避免修复该类