[jboss-jira] [JBoss JIRA] (WFLY-3310) NavigationHandler initialization is not thread-safe
Farah Juma (JIRA)
issues at jboss.org
Tue May 20 17:30:56 EDT 2014
[ https://issues.jboss.org/browse/WFLY-3310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969191#comment-12969191 ]
Farah Juma commented on WFLY-3310:
----------------------------------
[JAVASERVERFACES-3265 | https://java.net/jira/browse/JAVASERVERFACES-3265] has now been resolved. The fix will be included in the Mojarra 2.2.7 release.
> NavigationHandler initialization is not thread-safe
> ---------------------------------------------------
>
> Key: WFLY-3310
> URL: https://issues.jboss.org/browse/WFLY-3310
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: JSF
> Affects Versions: 8.0.0.Final
> Environment: Ubuntu 14.04, Oracle JDK 1.8.0_05
> Reporter: Harald Wellmann
> Assignee: Farah Juma
>
> Running a stress test on my application with a large number of concurrent clients, I'm getting the following exception:
> {noformat}
> Caused by: java.lang.NullPointerException
> at com.sun.faces.application.NavigationHandlerImpl$NavigationInfo.access$000(NavigationHandlerImpl.java:1364) [jsf-impl-2.2.5-jbossorg-3.jar:]
> at com.sun.faces.application.NavigationHandlerImpl.getNavigationMap(NavigationHandlerImpl.java:296) [jsf-impl-2.2.5-jbossorg-3.jar:]
> at com.sun.faces.application.NavigationHandlerImpl.getViewId(NavigationHandlerImpl.java:478) [jsf-impl-2.2.5-jbossorg-3.jar:]
> at com.sun.faces.application.NavigationHandlerImpl.getNavigationCase(NavigationHandlerImpl.java:149) [jsf-impl-2.2.5-jbossorg-3.jar:]
> at com.sun.faces.application.NavigationHandlerImpl.getNavigationCase(NavigationHandlerImpl.java:140) [jsf-impl-2.2.5-jbossorg-3.jar:]
> {noformat}
> This exception no longer occurs when the application has been warmed up by running a single request before going parallel.
> The root cause appears to be in {{com.sun.faces.application.NavigationHandlerImpl}}:
> {code}
> private void createNavigationMaps() {
> if (null == navigationMaps) {
> NavigationMap result = null;
> NavigationInfo info = null;
> navigationMaps = new ConcurrentHashMap<String, NavigationInfo>();
> result = new NavigationMap();
> info = new NavigationInfo();
> info.ruleSet = result;
> navigationMaps.put(ROOT_NAVIGATION_MAP_ID, info);
> }
> }
> {code}
> The member {{this.navigationMaps}} is set *before* {{ROOT_NAVIGATION_MAP_ID}} is put into the map, so another thread may get null from {{navigationMap.get(ROOT_NAVIGATION_MAP_ID)}} in method {{getNavigationMap()}}.
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
More information about the jboss-jira
mailing list