[jboss-jira] [JBoss JIRA] (WFLY-3310) NavigationHandler initialization is not thread-safe

Farah Juma (JIRA) issues at jboss.org
Tue Jun 24 15:51:24 EDT 2014


     [ https://issues.jboss.org/browse/WFLY-3310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Farah Juma resolved WFLY-3310.
------------------------------

    Fix Version/s: 8.2.0.CR1
                   9.0.0.Alpha1
       Resolution: Done


> 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
>             Fix For: 8.2.0.CR1, 9.0.0.Alpha1
>
>
> 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.6#6264)


More information about the jboss-jira mailing list