Bug 715380 - Uncaught exception defining Alert that triggers CLI script
Uncaught exception defining Alert that triggers CLI script
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
4.1
All All
high Severity medium (vote)
: ---
: ---
Assigned To: Jay Shaughnessy
Mike Foley
:
Depends On: 736762
Blocks: rhq41 rhq41-ui
  Show dependency treegraph
 
Reported: 2011-06-22 14:02 EDT by Mike Foley
Modified: 2012-02-07 14:25 EST (History)
2 users (show)

See Also:
Fixed In Version: 4,1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-07 14:25:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
CLI Alert script (2.89 KB, text/javascript)
2011-08-24 13:29 EDT, Mike Foley
no flags Details

  None (edit)
Description Mike Foley 2011-06-22 14:02:47 EDT
Description of problem:  Uncaught exception defining Alert that triggers CLI script when repository is null


Version-Release number of selected component (if applicable):
4.1

How reproducible:


Steps to Reproduce:
1.  Follow the steps here:  http://metlos.wordpress.com/2011/03/08/scripted-alert-notifications-in-rhq/
.
  
Actual results:
com.google.gwt.core.client.JavaScriptException:(TypeError): this$static.org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_config.org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm$Config_selectedRepo is null stack: org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_$validatePackage__Lorg_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_2Lcom_google_gwt_user_client_rpc_AsyncCallback_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:60713 org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_validate__Lcom_google_gwt_user_client_rpc_AsyncCallback_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:60769 org_rhq_enterprise_gui_coregui_client_alert_definitions_NewNotificationEditor$3_onClick__Lcom_smartgwt_client_widgets_form_fields_events_ClickEvent_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:64260 com_smartgwt_client_widgets_form_fields_events_ClickEvent_dispatch__Lcom_google_gwt_event_shared_EventHandler_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:22296 com_google_gwt_event_shared_HandlerManager$HandlerRegistry_$fireEvent__Lcom_google_gwt_event_shared_HandlerManager$HandlerRegistry_2Lcom_google_gwt_event_shared_GwtEvent_2ZV([object Object],[object Object],false)@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:4308 com_google_gwt_event_shared_HandlerManager_$fireEvent__Lcom_google_gwt_event_shared_HandlerManager_2Lcom_google_gwt_event_shared_GwtEvent_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:4176 com_smartgwt_client_core_DataClass_fireEvent__Lcom_google_gwt_event_shared_GwtEvent_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:12980 ([object Object],[object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:21166 com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2((function () {var param = {form: arguments[0], item: arguments[1]};var event = com_smartgwt_client_widgets_form_fields_events_ClickEvent_$ClickEvent__Lcom_smartgwt_client_widgets_form_fields_events_ClickEvent_2Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_smartgwt_client_widgets_form_fields_events_ClickEvent_2(new com_smartgwt_client_widgets_form_fields_events_ClickEvent, param);selfJ.fireEvent__Lcom_google_gwt_event_shared_GwtEvent_2V(event);}),[object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:2474 ([object Object],[object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:2463 isc_FormItem__fireStandardHandler("click")@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Forms.js:1366 isc_FormItem_handleClick()@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Forms.js:1371 isc_c_Class_invokeSuper(null,"handleClick")@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:279 isc_c_Class_Super("handleClick",[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:271 isc_ButtonItem_handleClick()@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Forms.js:1883 ([object Object],(void 0))@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Forms.js:1877 isc_StatefulCanvas_handleActivate([object Object],(void 0))@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Foundation.js:296 isc_StatefulCanvas_handleClick([object Object],(void 0))@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Foundation.js:298 isc_c_EventHandler_bubbleEvent([object Object],"click")@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1497 isc_c_EventHandler_handleClick([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1345 isc_c_EventHandler__handleMouseUp([object MouseEvent],(void 0))@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1332 isc_c_EventHandler_handleMouseUp([object MouseEvent])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1323 isc_c_EventHandler_dispatch(isc_c_EventHandler_handleMouseUp,[object MouseEvent])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1560 anonymous([object MouseEvent])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:38 fileName: http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html lineNumber: 60713
--- STACK TRACE FOLLOWS ---
(TypeError): this$static.org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_config.org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm$Config_selectedRepo is null stack: org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_$validatePackage__Lorg_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_2Lcom_google_gwt_user_client_rpc_AsyncCallback_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:60713 org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_validate__Lcom_google_gwt_user_client_rpc_AsyncCallback_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:60769 org_rhq_enterprise_gui_coregui_client_alert_definitions_NewNotificationEditor$3_onClick__Lcom_smartgwt_client_widgets_form_fields_events_ClickEvent_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:64260 com_smartgwt_client_widgets_form_fields_events_ClickEvent_dispatch__Lcom_google_gwt_event_shared_EventHandler_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:22296 com_google_gwt_event_shared_HandlerManager$HandlerRegistry_$fireEvent__Lcom_google_gwt_event_shared_HandlerManager$HandlerRegistry_2Lcom_google_gwt_event_shared_GwtEvent_2ZV([object Object],[object Object],false)@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:4308 com_google_gwt_event_shared_HandlerManager_$fireEvent__Lcom_google_gwt_event_shared_HandlerManager_2Lcom_google_gwt_event_shared_GwtEvent_2V([object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:4176 com_smartgwt_client_core_DataClass_fireEvent__Lcom_google_gwt_event_shared_GwtEvent_2V([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:12980 ([object Object],[object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:21166 com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2((function () {var param = {form: arguments[0], item: arguments[1]};var event = com_smartgwt_client_widgets_form_fields_events_ClickEvent_$ClickEvent__Lcom_smartgwt_client_widgets_form_fields_events_ClickEvent_2Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_smartgwt_client_widgets_form_fields_events_ClickEvent_2(new com_smartgwt_client_widgets_form_fields_events_ClickEvent, param);selfJ.fireEvent__Lcom_google_gwt_event_shared_GwtEvent_2V(event);}),[object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:2474 ([object Object],[object Object],[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html:2463 isc_FormItem__fireStandardHandler("click")@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Forms.js:1366 isc_FormItem_handleClick()@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Forms.js:1371 isc_c_Class_invokeSuper(null,"handleClick")@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:279 isc_c_Class_Super("handleClick",[object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:271 isc_ButtonItem_handleClick()@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Forms.js:1883 ([object Object],(void 0))@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Forms.js:1877 isc_StatefulCanvas_handleActivate([object Object],(void 0))@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Foundation.js:296 isc_StatefulCanvas_handleClick([object Object],(void 0))@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Foundation.js:298 isc_c_EventHandler_bubbleEvent([object Object],"click")@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1497 isc_c_EventHandler_handleClick([object Object])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1345 isc_c_EventHandler__handleMouseUp([object MouseEvent],(void 0))@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1332 isc_c_EventHandler_handleMouseUp([object MouseEvent])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1323 isc_c_EventHandler_dispatch(isc_c_EventHandler_handleMouseUp,[object MouseEvent])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:1560 anonymous([object MouseEvent])@http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/modules/ISC_Core.js:38 fileName: http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/341D86321ECE4289E0459672BA4BDE1F.cache.html lineNumber: 60713
    at Unknown.org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_$validatePackage__Lorg_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_2Lcom_google_gwt_user_client_rpc_AsyncCallback_2V(Unknown source:0)
    at Unknown.org_rhq_enterprise_gui_coregui_client_alert_definitions_CliNotificationSenderForm_validat


Expected results:


Additional info:
Comment 1 Jay Shaughnessy 2011-08-21 10:28:56 EDT
I'm not able to reproduce this issue. I've been able to define a cli alert sender and played with the various options in the gui.  This problem may have already been fixed and should be re-qualified.

Having said that, I can't actually get the script to run successfully.  No matter what user I set (Myself or another user) I seem to get a server-side failure like:

Caused by: org.rhq.enterprise.server.authz.PermissionException: The subject [rhqadmin] did not have a session: invocation: method=public org.rhq.core.domain.resource.Resource org.r
hq.enterprise.server.resource.ResourceManagerBean.getResource(org.rhq.core.domain.auth.Subject,int),context-data={}

Looking into this further.  As an aside, I am using Windows.
Comment 2 Jay Shaughnessy 2011-08-21 11:02:24 EDT
I think I need to talk this over with lkrejci or some others. To me it looks like we never actually login the user specified on the cli alert sender.  But if so I'm not sure how this ever worked, unless it was somehow relying on the legacy session 'feature' where multiple logins for the same user shared a session.

putting this on hold until I can get more info...
Comment 3 Jay Shaughnessy 2011-08-22 09:50:36 EDT
mazz, assigning to you just to see if you can replicate the problem
I'm seeing.  If you see the same we can take a look at it
together.

If you see the same, take a look at LocalClient, it seems to me the
login/logout code is never actually utilized.
Comment 4 John Mazzitelli 2011-08-22 16:55:23 EDT
gave some suggested fix. jay will test and commit
Comment 5 Jay Shaughnessy 2011-08-22 17:35:21 EDT
master commit 28ad282ea3d014f3fb4483e2a311958f7e425299

The gui exception in this bz seems to have been fixed previously. 

But there was an additional issue that prevented scripts from running 
because it tried to run them without a session.  This may have worked 
in the past, well back, before we fixed our session handling, because 
the sender may have been able to piggyback on an existing session. For 
example, if rhqadmin was logged into a gui session, and the script was 
being run as rhqadmin, it would have worked. But no more.  So, this fix 
from mazz gives the runner a proper session. Note that a very small 
portion of the script's timeout period is now devoted to generating a 
script engine with a valid session.  Also, the session is now eagerly
terminated in a finally.
Comment 6 Mike Foley 2011-08-24 13:29:27 EDT
Created attachment 519673 [details]
CLI Alert script
Comment 7 Mike Foley 2011-08-24 13:30:09 EDT
retesting.  having some trouble still running the script.  attached the script i am trying to run.
Comment 8 Mike Foley 2011-09-08 12:03:57 EDT
retesting.  i have logged this BZ while trying to verify.  https://bugzilla.redhat.com/show_bug.cgi?id=736762
Comment 9 Mike Foley 2011-09-27 11:09:41 EDT
i was able to define an alert with a CLI script without exception.
Comment 10 Mike Foley 2012-02-07 14:25:10 EST
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE

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