我刚刚在Wildfly 10.1.0上部署了我的应用程序,一切正常,会话正在两台服务器上进行复制。当我关闭其中一个服务器时,应用程序停止工作,在日志中我发现以下异常:
org.jboss.weld.exceptions.IllegalStateException: WELD-000227: Bean identifier index inconsistency detected - the distributed container probably does not work with identical applications
Expected hash: -2060331753
Current index: BeanIdentifierIndex [hash=-1812185259, indexed=31]
0: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_EAI.war%HttpSession
1: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_ESB.war%HttpSession
2: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_ESB.war/WEB-INF/lib/spring-web-3.1.1.RELEASE.jar%HttpSession
3: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_ESB.war/WEB-INF/lib/spring-webmvc-3.1.1.RELEASE.jar%HttpSession
4: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/ajaxanywhere-1.2.1.jar%HttpSession
5: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/axis-1.4.jar%HttpSession
6: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/cas-client-core-3.2.1.jar%HttpSession
7: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/ckeditor-java-core-3.5.3.jar%HttpSession
8: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/dwr-2.0.2.jar%HttpSession
9: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/jstl-1.0.6.jar%HttpSession
10: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/openamf-1.12.jar%HttpSession
11: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/sis-utility-0.5.jar%HttpSession
12: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/standard-1.0.6.jar%HttpSession
13: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/struts-1.1.jar%HttpSession
14: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/struts2-core-2.3.24.jar%HttpSession
15: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/taglibs-unstandard-20060829.jar%HttpSession
16: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/tiles-jsp-3.0.1.jar%HttpSession
17: WELD%AbstractBuiltInBean%/content/PATT_EAR.ear/PATT_WEB.war/WEB-INF/lib/velocity-tools-2.0.jar%HttpSession
18: WELD%AbstractBuiltInBean%PATT_EAR.ear%HttpSession
19: WELD%AbstractBuiltInBean%PATT_EAR.ear/ArchivageRemoting.war%HttpSession
20: WELD%AbstractBuiltInBean%PATT_EAR.ear/PATT_BATCH.war/WEB-INF/classes%HttpSession
21: WELD%AbstractBuiltInBean%PATT_EAR.ear/PATT_REMOTING.war%HttpSession
22: WELD%AbstractBuiltInBean%PATT_EAR.ear/PATT_SERVICES.war%HttpSession
23: WELD%AbstractBuiltInBean%PATT_EAR.ear/PATT_WEB.war/WEB-INF/classes%HttpSession
24: WELD%AbstractBuiltInBean%com.sun.jsf-impl:main.additionalClasses%HttpSession
25: WELD%AbstractBuiltInBean%org.hibernate.validator.cdi:main.additionalClasses%HttpSession
26: WELD%AbstractBuiltInBean%org.jberet.jberet-core:main.additionalClasses%HttpSession
27: WELD%AbstractBuiltInBean%org.jboss.as.jsf:main.additionalClasses%HttpSession
28: WELD%AbstractBuiltInBean%org.jboss.jts:main.additionalClasses%HttpSession
29: WELD%AbstractBuiltInBean%org.jboss.resteasy.resteasy-cdi:main.additionalClasses%HttpSession
30: WELD%AbstractBuiltInBean%org.wildfly.extension.messaging-activemq:main.additionalClasses%HttpSession
at org.jboss.weld.context.http.HttpSessionContextImpl.checkBeanIdentifierIndexConsistency(HttpSessionContextImpl.java:101)
at org.jboss.weld.context.http.HttpSessionContextImpl.associate(HttpSessionContextImpl.java:47)
at org.jboss.weld.context.http.HttpSessionContextImpl.associate(HttpSessionContextImpl.java:23)
at org.jboss.weld.servlet.HttpContextLifecycle.requestInitialized(HttpContextLifecycle.java:237)
at org.jboss.weld.servlet.WeldInitialListener.requestInitialized(WeldInitialListener.java:152)
at io.undertow.servlet.core.ApplicationListeners.requestInitialized(ApplicationListeners.java:246)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:291)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
有什么想法吗?
由于
答案 0 :(得分:0)
我处理了这个问题。问题是部署结构的差异。可能是一个新的模块或库。
在我的服务器上,我为org.jboss.weld.Bootstrap
打开了DEBUG级别并看到了
DEBUG [org.jboss.weld.Bootstrap] (MSC service thread 1-1) WELD-000145: Bean identifier index built:
BeanIdentifierIndex [hash=-1846478689, indexed=8]
0: WELD%AbstractBuiltInBean%/media/disk/Program_Files/wildfly-10.1.0-money-2/standalone/deployments/money-rest-v1-app.ear/money-ejb-module.jar%HttpSession
1: WELD%AbstractBuiltInBean%com.sun.jsf-impl:main.additionalClasses%HttpSession
2: WELD%AbstractBuiltInBean%money-rest-v1-app.ear%HttpSession
3: WELD%AbstractBuiltInBean%money-rest-v1-app.ear/money-rest-v1-war-module.war/WEB-INF/classes%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
一个bean标识符包含完整的部署路径。在第二台服务器上,此路径不同。哈希是不同的。
我将项目部署为压缩存档并且问题消失了。
第二种方法是-Dorg.jboss.weld.serialization.beanIdentifierIndexOptimization=false
。 19.1.9. Bean identifier index optimization