It was discovered that a "Globally uncaught exception" was generated in the GUI when a new Log Event Source was added using JBoss ON CLI with certain properties (even unset ones) not defined. This issue occurred even when the script added a seemingly correct Log Event Source. Any attempt to make a change (for example, disabling the Event Source) would generate the error. The fix implements improvements to the GUI ConfigurationEditor, which ensures unset fields' default values are added as required.
Description of problem:
Addition of new Log Event Source using JBoss ON CLI will break the UI if all properties (even unset ones) are not added
Version-Release number of selected component (if applicable):
JBoss ON 3
How reproducible:
Always
Steps to Reproduce:
1. Create a script that will add a new Log Event Source - for instance something like:
*********************************************************
...
//find a resource
...
var resource = ProxyFactory.getResource(resources.get(i).id);
var config = resource.getPluginConfiguration();
var logEventSources = config.getList("logEventSources").getList();
var update = new PropertyMap("logEventSource");
update.put(new org.rhq.core.domain.configuration.PropertySimple("minimumSeverity", "error"));
update.put(new org.rhq.core.domain.configuration.PropertySimple("logFilePath", "/opt/jboss/jon-agent/logs/cert-check.log"));
update.put(new org.rhq.core.domain.configuration.PropertySimple("enabled",true));
logEventSources.add(update);
resource.updatePluginConfiguration(config);
*********************************************************
Actual results:
Above script will add a new Log Event Source and on a first look it will seem correct in the resource's Connection Settings page but any attempt to make a change - for instance to disable this Event Source will generate a "Globally uncaught exception" in UI and the following is logged there:
****************************************
fileName: http://server.example.com:7080/coregui/org.rhq.coregui.CoreGUI/C5C5B3F91D68ACB5BF0139DFBBE3299F.cache.html
lineNumber: 20604: this$static is undefined
at Unknown.Throwable_2(Unknown Source)
at Unknown.RuntimeException_2(Unknown Source)
at Unknown.UmbrellaException_2(Unknown Source)
at Unknown.UmbrellaException_4(Unknown Source)
at Unknown.$fireEvent(Unknown Source)
at Unknown.$fireEvent_0(Unknown Source)
at Unknown.fireEvent_0(Unknown Source)
at Unknown.anonymous(Unknown Source)
at Unknown.apply(Unknown Source)
at Unknown.entry0(Unknown Source)
at Unknown.anonymous(Unknown Source)
at Unknown.isc_StatefulCanvas_handleActivate(Unknown Source)
at Unknown.isc_StatefulCanvas_handleClick(Unknown Source)
at Unknown.isc_c_EventHandler_bubbleEvent(Unknown Source)
at Unknown.isc_c_EventHandler_handleClick(Unknown Source)
at Unknown.isc_c_EventHandler__handleMouseUp(Unknown Source)
at Unknown.isc_c_EventHandler_handleMouseUp(Unknown Source)
at Unknown.isc_c_EventHandler_dispatch(Unknown Source)
at Unknown.anonymous(Unknown Source)
at Unknown.anonymous(Unknown Source)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError)
****************************************
Expected results:
No exception is thrown and it is possible to change Event Sources parameters.
Additional info:
If we change the code to execute the following:
***********************************************
var resource = ProxyFactory.getResource(resources.get(i).id);
var config = resource.getPluginConfiguration();
var logEventSources = config.getList("logEventSources").getList();
var update = new PropertyMap("logEventSource");
update.put(new org.rhq.core.domain.configuration.PropertySimple("minimumSeverity", "error"));
update.put(new org.rhq.core.domain.configuration.PropertySimple("logFilePath", "/opt/jboss/jon-agent/logs/cert-check.log"));
update.put(new org.rhq.core.domain.configuration.PropertySimple("enabled",true));
update.put(new org.rhq.core.domain.configuration.PropertySimple("includesPattern", null));
update.put(new org.rhq.core.domain.configuration.PropertySimple("dateFormat", null));
logEventSources.add(update);
resource.updatePluginConfiguration(config);
***********************************************
everything will work fine. However, we shouldn't have to do this as includesPattern and dateFormat are not set and as such those parameters should be added by default.
master commit 008dba2cfc66770d4422d2a23ede2327ad93d78c
Author: Jay Shaughnessy <jshaughn>
Date: Thu Sep 18 16:05:45 2014 -0400
Add support for the missing properties in this use case.
release/jon3.3.x commit 68cfb701ea447aa756266ed844feed85818bb675
Author: Jay Shaughnessy <jshaughn>
Date: Thu Sep 18 16:05:45 2014 -0400
(cherry picked from commit 008dba2cfc66770d4422d2a23ede2327ad93d78c)
Signed-off-by: Jay Shaughnessy <jshaughn>
Description of problem: Addition of new Log Event Source using JBoss ON CLI will break the UI if all properties (even unset ones) are not added Version-Release number of selected component (if applicable): JBoss ON 3 How reproducible: Always Steps to Reproduce: 1. Create a script that will add a new Log Event Source - for instance something like: ********************************************************* ... //find a resource ... var resource = ProxyFactory.getResource(resources.get(i).id); var config = resource.getPluginConfiguration(); var logEventSources = config.getList("logEventSources").getList(); var update = new PropertyMap("logEventSource"); update.put(new org.rhq.core.domain.configuration.PropertySimple("minimumSeverity", "error")); update.put(new org.rhq.core.domain.configuration.PropertySimple("logFilePath", "/opt/jboss/jon-agent/logs/cert-check.log")); update.put(new org.rhq.core.domain.configuration.PropertySimple("enabled",true)); logEventSources.add(update); resource.updatePluginConfiguration(config); ********************************************************* Actual results: Above script will add a new Log Event Source and on a first look it will seem correct in the resource's Connection Settings page but any attempt to make a change - for instance to disable this Event Source will generate a "Globally uncaught exception" in UI and the following is logged there: **************************************** fileName: http://server.example.com:7080/coregui/org.rhq.coregui.CoreGUI/C5C5B3F91D68ACB5BF0139DFBBE3299F.cache.html lineNumber: 20604: this$static is undefined at Unknown.Throwable_2(Unknown Source) at Unknown.RuntimeException_2(Unknown Source) at Unknown.UmbrellaException_2(Unknown Source) at Unknown.UmbrellaException_4(Unknown Source) at Unknown.$fireEvent(Unknown Source) at Unknown.$fireEvent_0(Unknown Source) at Unknown.fireEvent_0(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.apply(Unknown Source) at Unknown.entry0(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.isc_StatefulCanvas_handleActivate(Unknown Source) at Unknown.isc_StatefulCanvas_handleClick(Unknown Source) at Unknown.isc_c_EventHandler_bubbleEvent(Unknown Source) at Unknown.isc_c_EventHandler_handleClick(Unknown Source) at Unknown.isc_c_EventHandler__handleMouseUp(Unknown Source) at Unknown.isc_c_EventHandler_handleMouseUp(Unknown Source) at Unknown.isc_c_EventHandler_dispatch(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) **************************************** Expected results: No exception is thrown and it is possible to change Event Sources parameters. Additional info: If we change the code to execute the following: *********************************************** var resource = ProxyFactory.getResource(resources.get(i).id); var config = resource.getPluginConfiguration(); var logEventSources = config.getList("logEventSources").getList(); var update = new PropertyMap("logEventSource"); update.put(new org.rhq.core.domain.configuration.PropertySimple("minimumSeverity", "error")); update.put(new org.rhq.core.domain.configuration.PropertySimple("logFilePath", "/opt/jboss/jon-agent/logs/cert-check.log")); update.put(new org.rhq.core.domain.configuration.PropertySimple("enabled",true)); update.put(new org.rhq.core.domain.configuration.PropertySimple("includesPattern", null)); update.put(new org.rhq.core.domain.configuration.PropertySimple("dateFormat", null)); logEventSources.add(update); resource.updatePluginConfiguration(config); *********************************************** everything will work fine. However, we shouldn't have to do this as includesPattern and dateFormat are not set and as such those parameters should be added by default.