Bug 754521

Summary: NPE occurs when navigating away from Resource detail view before that view has finished loading
Product: [Other] RHQ Project Reporter: Ian Springer <ian.springer>
Component: Core UIAssignee: Charles Crouch <ccrouch>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2CC: ccrouch, hbrock, hrupp
Target Milestone: ---   
Target Release: RHQ 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-01 06:00:36 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 730796, 735475    

Description Ian Springer 2011-11-16 12:56:32 EST
I went to a Resource detail view and then quickly clicked on the Dashboard link to navigate away before the Resource detail view had finished loading. I got the following globally uncaught exception:

java.lang.NullPointerException:null
--- STACK TRACE FOLLOWS ---
null
   at org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeDatasource.introduceTypeAndCategoryNodes(ResourceTreeDatasource.java:244)
   at org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeDatasource.buildNodes(ResourceTreeDatasource.java:197)
   at org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeDatasource$2.onResourceTypeLoaded(ResourceTreeDatasource.java:177)
   at org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository$1.onTypesLoaded(ResourceTypeRepository.java:140)
   at org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository$5.onSuccess(ResourceTypeRepository.java:438)
   at org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository$5.onSuccess(ResourceTypeRepository.java:1)
   at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:216)
   at org.rhq.enterprise.gui.coregui.client.util.rpc.TrackingRequestCallback.onResponseReceived(TrackingRequestCallback.java:89)
   at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
   at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:393)
   at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
   at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
   at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
   at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1714)
   at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
   at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
   at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
   at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
   at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
   at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
   at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
   at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
   at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
   at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
   at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1669)
   at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
   at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
   at java.lang.Thread.run(Thread.java:662)
Comment 1 Ian Springer 2012-02-15 10:28:26 EST
Fixed in master:

http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=b93446c

We now detect the condition and log a gwt DEBUG message like the following, rather than displaying an error message + stack trace to the user:

[INFO] (CoreGUI.java:160) 2012-02-15 10:21:49,493 [DEBUG] User navigated to view [Reports] before view [Resource/10079] was done rendering - rendering of view [Resource/10079] has been aborted.

QE, note, you would need to look at the browser's JavaScript console to see the DEBUG message.
Comment 2 Charles Crouch 2012-02-21 12:30:29 EST
Setting Target Release correctly.
Comment 5 Heiko W. Rupp 2013-09-01 06:00:36 EDT
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.