Jboss集群异常WELD-000227: Bean identifier index inconsistency detected

云霖
2023-12-01

wildfly9集群环境,集群启动后出现异常:

WELD-000227: Beanidentifier index inconsistency detected - the distributed container probablydoes not work with identical applications

Expected hash:-1201658851

Current index:BeanIdentifierIndex [hash=-1596094459, indexed=8]:

   0:WELD%AbstractBuiltInBean%/home/Wildfly9/standalone/deployments/test.war%HttpSession

   1:WELD%AbstractBuiltInBean%/home/Wildfly9/standalone/deployments/test.war/WEB-INF/lib/jstl.jar%HttpSession

   2:WELD%AbstractBuiltInBean%/home/Wildfly9/standalone/deployments/test.war/WEB-INF/lib/struts2-core-2.3.15.1.jar%HttpSession

   3:WELD%AbstractBuiltInBean%com.sun.jsf-impl:main.additionalClasses%HttpSession

   4:WELD%AbstractBuiltInBean%org.hibernate.validator.cdi:main.additionalClasses%HttpSession

   5: WELD%AbstractBuiltInBean%org.jberet.jberet-core:main.additionalClasses%HttpSession

   6:WELD%AbstractBuiltInBean%org.jboss.as.jsf:main.additionalClasses%HttpSession

   7:WELD%AbstractBuiltInBean%org.jboss.resteasy.resteasy-cdi:main.additionalClasses%HttpSession

从以下方面入手:
1、 standalone-ha.xml增加
<module name="org.codehaus.jackson.jackson-mapper-asl" slot="main"/>
<module name="org.codehaus.jackson.jackson-jaxrs" slot="main"/>
<module name="org.codehaus.jackson.jackson-xc" slot="main"/>
<module name="org.codehaus.jackson.jackson-core-asl" slot="main"/>

2、 增加module="deployment.commonVO.jar"。该jar是集群共享缓存值所用到的vo类包
<cache-container name="cluster-test" default-cache="default" jndi-name="java:jboss/infinispan/cluster-test" aliases="ha-partition-test" module="deployment.commonVO.jar">

3、 standalone-ha.xml<subsystem xmlns="urn:jboss:domain:weld:2.0"/>改为
<subsystem xmlns="urn:jboss:domain:weld:2.0" non-portable-mode="false" require-bean-descriptor="false"/>

4、 在/bin/standalone.conf添加JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.weld.serialization.beanIdentifierIndexOptimization=false"

 类似资料: