Bug 793853 (JBEPP-928) - NullPointerException if dashboard context is missing
Summary: NullPointerException if dashboard context is missing
Keywords:
Status: CLOSED NEXTRELEASE
Alias: JBEPP-928
Product: JBoss Enterprise Portal Platform 4
Classification: JBoss
Component: Portal
Version: 4.3.0.GA_CP6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.3.0.GA_CP7
Assignee: Thomas Heute
QA Contact:
URL: http://jira.jboss.org/jira/browse/JBE...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-10 13:03 UTC by Martin Weiler
Modified: 2012-02-28 16:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-06 16:01:56 UTC
Type: Bug


Attachments (Terms of Use)
JBEPP-928.patch (1.72 KB, text/x-patch)
2011-05-10 13:21 UTC, Martin Weiler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEPP-928 0 None None None Never

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.



Note You need to log in before you can comment on or make changes to this bug.