You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
When deploying an EAR that contains multiple JSF web apps to JBoss EAP 6.x, the following ArrayIndexOutOfBoundsException sometimes occurs:
15:53:37,291 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 59) Critical error during deployment: : java.lang.ArrayIndexOutOfBoundsException: 3
at com.sun.faces.el.DemuxCompositeELResolver._addRootELResolver(DemuxCompositeELResolver.java:114) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.el.DemuxCompositeELResolver.addRootELResolver(DemuxCompositeELResolver.java:142) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.el.ELUtils.addVariableResolvers(ELUtils.java:610) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.el.ELUtils.buildFacesResolver(ELUtils.java:242) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.application.ApplicationAssociate.initializeELResolverChains(ApplicationAssociate.java:367) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.application.ApplicationImpl.performOneTimeELInitialization(ApplicationImpl.java:1320) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.application.ApplicationImpl.getELResolver(ApplicationImpl.java:464) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at org.jboss.as.weld.webtier.jsf.ForwardingApplication.getELResolver(ForwardingApplication.java:220) [jboss-as-weld-7.3.2.Final-redhat-SNAPSHOT.jar:7.3.2.Final-redhat-SNAPSHOT]
at javax.faces.application.ApplicationWrapper.getELResolver(ApplicationWrapper.java:556) [jboss-jsf-api_2.1_spec-2.1.27.Final-redhat-1.jar:2.1.27.Final-redhat-1]
at org.jboss.seam.faces.environment.SeamApplicationWrapper$Proxy$_$$_WeldClientProxy.getELResolver(SeamApplicationWrapper$Proxy$_$$_WeldClientProxy.java) [cim-data-converters-0.8.19-SNAPSHOT.jar:0.8.19-SNAPSHOT]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:235) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
The underlying issue seems to be that when multiple JSF web apps are deployed in parallel, it's possible for two threads to execute ApplicationImpl#getELResolver() at the same time. In this case, it's possible for both threads to get past the null check in ApplicationImpl#performOneTimeELInitialization, causing this initialization to be executed twice, in parallel. This ultimately results in the ArrayIndexOutOfBoundsException shown above.
The following patch fixes this problem by placing the call to performOneTimeELInitialization in a synchronized block:
diff --git a/jsf-ri/src/main/java/com/sun/faces/application/ApplicationImpl.java b/jsf-ri/src/main/java/com/sun/faces/application/ApplicationImpl.java
index 4a6dde5..f7fee20 100644
--- a/jsf-ri/src/main/java/com/sun/faces/application/ApplicationImpl.java
+++ b/jsf-ri/src/main/java/com/sun/faces/application/ApplicationImpl.java
@@ -461,7 +461,11 @@ public class ApplicationImpl extends Application {
public ELResolver getELResolver() {
if (compositeELResolver == null) {
- performOneTimeELInitialization();
+ synchronized(this) {
+if (compositeELResolver == null) {
+ performOneTimeELInitialization();
+}
+ }
}
return compositeELResolver;
Environment
EAP 6.2.2, Mojarra 2.1.27
Affected Versions
[1.2_16]
The text was updated successfully, but these errors were encountered:
When deploying an EAR that contains multiple JSF web apps to JBoss EAP 6.x, the following ArrayIndexOutOfBoundsException sometimes occurs:
The underlying issue seems to be that when multiple JSF web apps are deployed in parallel, it's possible for two threads to execute ApplicationImpl#getELResolver() at the same time. In this case, it's possible for both threads to get past the null check in ApplicationImpl#performOneTimeELInitialization, causing this initialization to be executed twice, in parallel. This ultimately results in the ArrayIndexOutOfBoundsException shown above.
The following patch fixes this problem by placing the call to performOneTimeELInitialization in a synchronized block:
Environment
EAP 6.2.2, Mojarra 2.1.27
Affected Versions
[1.2_16]
The text was updated successfully, but these errors were encountered: