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:
Marking this urgent to indicate it should be checked in JON3.0.0CR1
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$
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") + "'!"); } } }
re-verified CR4
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE