Bug 1455102

Summary: Error when trying to save agent:SNMP plugin configuration in RHQ UI
Product: [Other] RHQ Project Reporter: bkramer <bkramer>
Component: Core UIAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.12CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1455091    

Description bkramer 2017-05-24 09:37:55 UTC
Description of problem:
Attempt to save change in the agent:SNMP plugin configuration fails with "Failed to save the settings" message in the UI. At the same time RHQ server.log file logs:

************************************
WARN  [org.rhq.coregui.server.gwt.PluginGWTServiceImpl] (http-0.0.0.0:7080-23) Sending exception to client: [1495522648837] : org.rhq.core.domain.plugin.PluginConfigurationRequiredException: Plugin [Alert:SNMP] could not be enabled, because some required configuration fields are not set.
	at org.rhq.enterprise.server.plugin.ServerPluginManagerBean.checkForRequiredConfiguration(ServerPluginManagerBean.java:278) [rhq-server.jar:4.12.0.JON330GA-redhat-7]
	at org.rhq.enterprise.server.plugin.ServerPluginManagerBean.enableServerPlugins(ServerPluginManagerBean.java:245) [rhq-server.jar:4.12.0.JON330GA-redhat-7]
...
	at org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(RequiredPermissionsInterceptor.java:156) [rhq-server.jar:4.12.0.JON330GA-redhat-7]
...
	at org.rhq.enterprise.server.plugin.ServerPluginManagerLocal$$$view16.enableServerPlugins(Unknown Source) [rhq-server.jar:4.12.0.JON330GA-redhat-7]
	at org.rhq.coregui.server.gwt.PluginGWTServiceImpl.updateServerPluginConfiguration(PluginGWTServiceImpl.java:416) [classes:]
...

************************************
My test showed that this happens only if we leave Transport defined as UDP and *ONLY* first time when the configuration is changed/saved. 


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

How reproducible:
Always

Steps to Reproduce:
1. Navigate to RHQ UI -> Administration -> Server Plugins -> Alert:SNMP -> Plugin Configuration
2. Default Transport is UDP. Make sure not to change this. 
3. Navigate to SNMP version1 properties and set Agent Address;
4. Click on "Save" button

Actual results:
"Failed to save the settings" error message is shown in the top right corner of the RHQ UI:

***********************************
Message :	
Failed to save the settings
Severity :	
Error
	
Time :	
Tuesday, May 23, 2017 10:31:09 AM UTC-5
Root Cause :	
[1495553469704] org.rhq.core.domain.plugin.PluginConfigurationRequiredException:Plugin [Alert:SNMP] could not be enabled, because some required configuration fields are not set.
Detail :	

java.lang.RuntimeException:[1495553469704] org.rhq.core.domain.plugin.PluginConfigurationRequiredException:Plugin [Alert:SNMP] could not be enabled, because some required configuration fields are not set.
--- STACK TRACE FOLLOWS ---
[1495553469704] org.rhq.core.domain.plugin.PluginConfigurationRequiredException:Plugin [Alert:SNMP] could not be enabled, because some required configuration fields are not set.
   at Unknown.RuntimeException_0(Unknown Source)
   at Unknown.instantiate_32(Unknown Source)
   at Unknown.$instantiate_0(Unknown Source)
   at Unknown.$instantiate(Unknown Source)
   at Unknown.$readObject(Unknown Source)
   at Unknown.$onResponseReceived(Unknown Source)
   at Unknown.onResponseReceived_4(Unknown Source)
   at Unknown.$fireOnResponseReceived(Unknown Source)
   at Unknown.onReadyStateChange_0(Unknown Source)
   at Unknown.$setOnReadyStateChange/this$static.onreadystatechange<(Unknown Source)
   at Unknown.apply(Unknown Source)
   at Unknown.entry0(Unknown Source)
   at Unknown.entry_0/<(Unknown Source)
   at Unknown.anonymous(Unknown Source)
***********************************
Even though the error is displayed, if I navigate to another page and then back to the Server Plugins > Alert:SNMP page the values are actually saved.

Expected results:

The values are properly saved and no error is logged/shown.

Additional info:

Previously logged the same error for JBoss ON: https://bugzilla.redhat.com/show_bug.cgi?id=1257741