Bug 793853 (JBEPP-928)

Summary: NullPointerException if dashboard context is missing
Product: [JBoss] JBoss Enterprise Portal Platform 4 Reporter: Martin Weiler <mweiler>
Component: PortalAssignee: Thomas Heute <theute>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.3.0.GA_CP6CC: epp-bugs
Target Milestone: ---   
Target Release: 4.3.0.GA_CP7   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBEPP-928
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-06 16:01:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
JBEPP-928.patch none

Description Martin Weiler 2011-05-10 13:03:42 UTC
Help Desk Ticket Reference: https://na7.salesforce.com/500A0000007AoQO
Steps to Reproduce: 1. Remove 'dashboard' context in jboss-portal[-ha].sar/conf/data/default-object.xml
2. Start the server and log in
project_key: JBEPP

Removing the dashboard context from default-object.xml results in the following NPE when a user logs in:

18:37:29,578 ERROR [ContainerBase] Servlet.service() for servlet PortalServletWithPathMapping threw exception 
java.lang.NullPointerException 
at org.jboss.portal.core.impl.model.CustomizationManagerService.getDashboardIdFor(CustomizationManagerService.java:374) 
at org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.injectDashboardNav(PageCustomizerInterceptor.java:256) 
at org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:164) 
at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)

The NPE is happening at this call:
Context dashboardContext = portalObjectContainer.getContext(dashboardContextId); 

As the getContext(String) method can return a null value, there should be a proper null check.

Comment 1 Martin Weiler 2011-05-10 13:21:36 UTC
Attaching patch proposal to address the NPE.

Comment 2 Martin Weiler 2011-05-10 13:21:36 UTC
Attachment: Added: JBEPP-928.patch


Comment 3 Scott Mumford 2011-07-12 05:58:38 UTC
Release Notes Docs Status: Added: Not Yet Documented


Comment 4 Jared MORGAN 2012-01-23 04:17:41 UTC
Release Notes Docs Status: Removed: Not Yet Documented Added: Documented as Resolved Issue
Release Notes Text: Added: Removing the dashboard context from default-object.xml resulted in a Null Pointer Exception (NPE) when a user authenticated. The fix ensures that a proper null check is performed at the dashboardContext = portalObjectContainer.getContext(dashboardContextId) call, which fixes the issue.