Bug 1143918 - Addition of new Log Event Source using JBoss ON CLI will break the UI if all properties (even unset ones) are not added
Summary: Addition of new Log Event Source using JBoss ON CLI will break the UI if all ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: CLI, Documentation
Version: JON 3.2.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER04
: JON 3.3.0
Assignee: Jay Shaughnessy
QA Contact: Filip Brychta
URL:
Whiteboard:
Depends On: 1143933
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-18 09:13 UTC by bkramer
Modified: 2018-12-06 18:02 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-12-11 13:59:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description bkramer 2014-09-18 09:13:55 UTC
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.

Comment 1 Jay Shaughnessy 2014-09-18 20:10:54 UTC
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>

Comment 2 Simeon Pinder 2014-10-01 21:33:10 UTC
Moving to ON_QA as available for test with build:
https://brewweb.devel.redhat.com/buildinfo?buildID=388959

Comment 4 Jay Shaughnessy 2014-10-13 13:39:06 UTC
Jared, I don't know what a CCFR is. Is this for a release not or something like that?  We (dev) haven't been asked for something like this in the past.

Comment 5 Filip Brychta 2014-10-13 14:33:46 UTC
Verified on
Version :	
3.3.0.ER04
Build Number :	
99d2107:d7c537e


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