Bug 967601 - Full class names (including packages) must be used in server CLI scripts
Summary: Full class names (including packages) must be used in server CLI scripts
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI, Core Server
Version: 4.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-27 14:23 UTC by Filip Brychta
Modified: 2022-03-31 04:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Filip Brychta 2013-05-27 14:23:09 UTC
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:
Always

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>
</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.