Bug 967601 - Full class names (including packages) must be used in server CLI scripts
Full class names (including packages) must be used in server CLI scripts
Status: NEW
Product: RHQ Project
Classification: Other
Component: CLI, Core Server (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2013-05-27 10:23 EDT by Filip Brychta
Modified: 2013-05-27 10:23 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Filip Brychta 2013-05-27 10:23:09 EDT
Description of problem:
I have a simple server CLI script:
var resC = new ResourceCriteria();

This script is invoked when the alert is fired and invocation fails with an exception.
However when the full class name is used:

var resC= new org.rhq.core.domain.criteria.ResourceCriteria();

script works correctly.

Version-Release number of selected component (if applicable):
Version: 4.8.0-SNAPSHOT
Build Number: ff37cd9

How reproducible:

Steps to Reproduce:
1. create an alarm definition with notification on some resource (i.e. platform)
  a. go to Alerts->Definitions->New
  b. fill some name
  c. add a condition - i.e. when some operation is invoked
  d. add a notification - choose a CLI script as a notification sender->upload the file (js file containing just var resC = new ResourceCriteria();)
  e. save the alert definition
2. invoke the operation from step c. 
3. go to Alerts->History
4. open relevant alert and check notification tab

Actual results:
Ran script script.js in version rhqadmin:1.18 from repo First as user rhqadmin.
javax.script.ScriptException:org.mozilla.javascript.EcmaError: ReferenceError: "ResourceCriteria" is not defined. (
<unknown source="">
#1) in
<unknown source=""> at line number 1 in script script.js (rhqadmin:1.18) in repo First at line number 1</unknown>

Expected results:
No errors

Additional info:
no problems when using a CLI client

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