Bug 753873 - RHQ Enterprise Remote CLI 3.0.1.GA throwing SecurityException: org.rhq.core.server.MeasurementConverter's signer information does not match signer information
RHQ Enterprise Remote CLI 3.0.1.GA throwing SecurityException: org.rhq.core.s...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
3.0.1
Unspecified Unspecified
urgent Severity urgent (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On: jon30-sprint8
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-14 12:57 EST by Harri Savolainen
Modified: 2012-02-07 14:27 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-07 14:27:39 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)

  None (edit)
Description Harri Savolainen 2011-11-14 12:57:01 EST
Description of problem

CLI Call to parent.userLoad.displayValue makes CLI to throw java.lang.SecurityExecption as follows:

sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.lang.SecurityException: class "org.rhq.core.server.MeasurementConverter"'s signer information does not match signer information of other classes in the same package. 

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

JON 2.4.1 with BZ746328 (Overlay patch) installed.
RHQ - RHQ Enterprise Remote CLI 3.0.1.GA
Remote server version is: 3.0.1.GA(81e26be20d)

How reproducible:

Every time using by using CLI.

Steps to Reproduce:
1. Fresh install of JON 2.4.1 Server with single agent
2. Install patch BZ746328
3. Use CLI to call server with following js
__ snip__
var criteria = new ResourceCriteria();
criteria.addFilterResourceTypeName("RHQ Agent");
var resources = ResourceManager.findResourcesByCriteria(criteria);
var resourcesArray = resources.toArray();
var parent = ProxyFactory.getResource(resourcesArray[0].parentResource.id);
println(parent.userLoad.displayValue);
__ snip __
Actual results:

# ./rhq-cli.sh -u rhqadmin -p rhqadmin -s localhost
RHQ - RHQ Enterprise Remote CLI 3.0.1.GA
Remote server version is: 3.0.1.GA(81e26be20d)
Login successful
rhqadmin@localhost:7080$ var criteria = new ResourceCriteria();
rhqadmin@localhost:7080$ criteria.addFilterResourceTypeName("RHQ Agent");
rhqadmin@localhost:7080$ var resources = ResourceManager.findResourcesByCriteria(criteria);
rhqadmin@localhost:7080$ var resourcesArray = resources.toArray();
rhqadmin@localhost:7080$ var parent = ProxyFactory.getResource(resourcesArray[0].parentResource.id);
rhqadmin@localhost:7080$ println(parent.userLoad.displayValue);
sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.lang.SecurityException: class "org.rhq.core.server.MeasurementConverter"'s signer information does not match signer information of other classes in the same package 
println(parent.userLoad.displayValue); 
^

Expected results:

Getting value of userLoad.displayValue

Additional info:
Comment 1 Charles Crouch 2011-11-14 13:20:03 EST
Marking this urgent to indicate it should be checked in JON3.0.0CR1
Comment 3 Mike Foley 2011-11-30 11:29:59 EST
documenting the behavior in JON CR3.  the CLI API has apparently changed, and the script is not valid.  however ... i am not getting any "signing" issues.   i did some other simple stuff with the CLI ... documented below ... no signing issues.  this is not an isue in JON 3 ... and the signing issue has been addressed in JON 2.4 ... so i am closing.  


rhqadmin@localhost:7080$ var criteria = new ResourceCriteria();
rhqadmin@localhost:7080$ criteria.addFilterResourceTypeName("RHQ Agent");
rhqadmin@localhost:7080$ var resources = ResourceManager.findResourcesByCriteria(criteria);
rhqadmin@localhost:7080$ var resourcesArray = resources.toArray();
rhqadmin@localhost:7080$ var parent = ProxyFactory.getResource(resourcesArray[0].parentResource.id);
TypeError: Cannot read property "parentResource" from undefined (<Unknown source>#1)
var parent = ProxyFactory.getResource(resourcesArray[0].parentResource.id); 
^
rhqadmin@localhost:7080$ println(parent.userLoad.displayValue);
TypeError: Cannot read property "userLoad" from undefined (<Unknown source>#1)
println(parent.userLoad.displayValue); 
^
rhqadmin@localhost:7080$ 



-----------
some simple stuff I did with the CLI ...

rhqadmin@localhost:7080$ println(resources);
PageList[]

rhqadmin@localhost:7080$ println(resources.toArray());
[Ljava.lang.Object;@17a323c0

rhqadmin@localhost:7080$
Comment 4 Mike Foley 2011-11-30 11:37:46 EST
additionally executed this sample CLI script ... which successfully ran without signing errors

var criteria = new ResourceCriteria();
criteria.addFilterResourceTypeName('JBossAS Server');
var asServers = ResourceManager.findResourcesByCriteria(criteria);
println("this is a test");
println("asServers = " + asServers.size());
if (asServers != null && asServers.size() > 0) { 
   for (var i = 0; i < asServers.size(); i++) { 
      var resource = asServers.get(i); 
      println("resource:" + resource.getName());
      if (resource.getName() != null && resource.getName().contains(" RHQ Server")) { 
         var av = AvailabilityManager.getCurrentAvailabilityForResource(subject, resource.getId()); 
         println("RHQ Server: " + resource.getName() + " [" + resource.getId()
+ "] has a current status from AvailabilityManager of '" + (av != null ?
av.getAvailabilityType() : "null") + "'!"); 
         println("RHQ Server: " + resource.getName() + " [" + resource.getId()
+ "] has a current status from Resource of '" +
(resource.getCurrentAvailability() != null ?
resource.getCurrentAvailability().getAvailabilityType() : "null") + "'!"); 
      } 
   } 
}
Comment 5 Mike Foley 2011-12-01 11:20:51 EST
re-verified CR4
Comment 6 Mike Foley 2012-02-07 14:27:39 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.