Bug 800410

Summary: NumberFormatException in Dashboard
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: Core UIAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: 4.3CC: ccrouch, hrupp, jsanda, jshaughn
Target Milestone: ---   
Target Release: RHQ 4.4.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-01 06:11:25 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 735475    

Description Heiko W. Rupp 2012-03-06 07:59:10 EST
Logged in with JA locale, killed the default dashboard, got a new one and added the auto discovery port let to it.
Then switched to a different locale - Dashboard does not properly display, but gives a global exception bar which yields this NFE:

Only way to get back going is to open a db-explorer and to remove the rows from rhq_dashboard_portles and rhq_dashboard

Exceção não capturada
Severidade :	
Error

Tempo :	
terça-feira, 6 de março de 2012 13h29min00s UTC+1
Detalhe :	
java.lang.NumberFormatException:For input string: "無制限"
--- STACK TRACE FOLLOWS ---
For input string: "無制限"
   at Unknown.java_lang_Exception_Exception__Ljava_lang_String_2V(Unknown Source)
   at Unknown.java_lang_RuntimeException_RuntimeException__Ljava_lang_String_2V(Unknown Source)
   at Unknown.java_lang_IllegalArgumentException_IllegalArgumentException__Ljava_lang_String_2V(Unknown Source)
   at Unknown.java_lang_NumberFormatException_NumberFormatException__Ljava_lang_String_2V(Unknown Source)
   at Unknown.java_lang_Number__1_1parseAndValidateInt__Ljava_lang_String_2IIII(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_dashboard_portlets_inventory_queue_AutodiscoveryPortlet_$configure__Lorg_rhq_enterprise_gui_coregui_client_dashboard_portlets_inventory_queue_AutodiscoveryPortlet_2Lorg_rhq_enterprise_gui_coregui_client_dashboard_PortletWindow_2Lorg_rhq_core_domain_dashboard_DashboardPortlet_2V(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_dashboard_portlets_inventory_queue_AutodiscoveryPortlet_configure__Lorg_rhq_enterprise_gui_coregui_client_dashboard_PortletWindow_2Lorg_rhq_core_domain_dashboard_DashboardPortlet_2V(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_dashboard_PortletFactory_buildPortlet__Ljava_lang_String_2Lorg_rhq_enterprise_gui_coregui_client_dashboard_PortletWindow_2Lorg_rhq_core_domain_dashboard_DashboardPortlet_2Lorg_rhq_core_domain_common_EntityContext_2Lorg_rhq_enterprise_gui_coregui_client_dashboard_Portlet_2(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_dashboard_PortletWindow_onInit__V(Unknown Source)
   at Unknown.com_smartgwt_client_widgets_BaseWidget_doInit__V(Unknown Source)
   at Unknown.com_smartgwt_client_widgets_Window_create__Lcom_google_gwt_core_client_JavaScriptObject_2(Unknown Source)
   at Unknown.com_smartgwt_client_widgets_BaseWidget_$getOrCreateJsObj__Lcom_smartgwt_client_widgets_BaseWidget_2Lcom_google_gwt_core_client_JavaScriptObject_2(Unknown Source)
   at Unknown.com_smartgwt_client_widgets_layout_Layout_$addMember__Lcom_smartgwt_client_widgets_layout_Layout_2Lcom_smartgwt_client_widgets_Canvas_2V(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_dashboard_PortalLayout_$addPortletWindow__Lorg_rhq_enterprise_gui_coregui_client_dashboard_PortalLayout_2Lorg_rhq_enterprise_gui_coregui_client_dashboard_PortletWindow_2ILorg_rhq_enterprise_gui_coregui_client_dashboard_PortalColumn_2(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_dashboard_DashboardView_$loadPortletWindows__Lorg_rhq_enterprise_gui_coregui_client_dashboard_DashboardView_2V(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_dashboard_DashboardView_$buildPortlets__Lorg_rhq_enterprise_gui_coregui_client_dashboard_DashboardView_2V(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_dashboard_DashboardView_onInit__V(Unknown Source)
   at Unknown.com_smartgwt_client_widgets_BaseWidget_doInit__V(Unknown Source)
Comment 2 Jay Shaughnessy 2012-03-15 17:11:48 EDT
I agree with Ian, we certainly should not be storing a localized value
in the portlet configuration. I don't think that was the intent, rather
it was probably just an accidental application of I18N to the special
string value being used.

Anyway, using -1 would be better.  This affects the following portlets:

Autodiscovery
RecentlyAddedResources
OperationSchedule
ProblemResources

Since it's quite difficult to update Configurations via a db upgrade
step, instead we'll just start using a proper value (-1) going forward,
and protect against the problem.
Comment 3 Jay Shaughnessy 2012-03-16 14:00:59 EDT
master commit 76f5bd8075b6a8d13757bcd86daca99d680239e1

Fix issues in four portlets that were storing a localized string as
a configuration setting value.  This caused issues if the locale was
changed after the setting was stored.  Now stores non-localized
values and also handles the legacy values when encountered (so, no
db upgrade step required).


Test Notes:
Note that this affects four different portlets, three of which are
non-default portlets that need to be added manually to your global
dashboard.
Comment 4 Heiko W. Rupp 2013-09-01 06:11:25 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.