Bug 567697 - Unable to initialize ConfigurationManager in CLI
Summary: Unable to initialize ConfigurationManager in CLI
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 3.0.0
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon24-cli
TreeView+ depends on / blocked
 
Reported: 2010-02-23 17:01 UTC by John Sanda
Modified: 2010-05-26 20:25 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-05-26 20:25:29 UTC
Embargoed:


Attachments (Terms of Use)

Description John Sanda 2010-02-23 17:01:25 UTC
Description of problem:
When executing the login command, you get an error message saying "Failed to load manager ConfigurationManager due to missing class: java.lang.reflect.InvocationTargetException". Login succeeds but the ConfigurationManager object does not get initialized as a result of the error; consequently, the ConfigurationManager operations are not accessible.

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


How reproducible:
always

Steps to Reproduce:
1. Start the cli (rhq-cli.sh)
2. Execute login command ($ login rhqadmin rhqadmin)
3. 
  
Actual results:
RHQ - RHQ Enterprise Remote CLI 3.0.0.B03
Remote server version is: 3.0.0.B03(b2804ea)
Failed to load manager ConfigurationManager due to missing class: java.lang.reflect.InvocationTargetException
Login successful
rhqadmin@localhost:7080$ 

Expected results:
There should be no error initializing ConfigurationManager

Additional info:
The wrapped exception inside InvocationTargetException is a NoClassDefFoundError for PluginContainerException. In the 3.0.0 release, the API for ConfigurationManager (i.e., ConfigurationManagerRemote) has a dependency on PluginContainerException which is not a dependency of the CLI.

Comment 1 John Sanda 2010-02-23 17:05:36 UTC
A temporary work around for this is to copy rhq-core-client-api-3.0.0-SNAPSHOT.jar into CLI_HOME/lib. That jar can be found in rhq.ear/lib.

In the current implementation of ConfigurationManagerBean, it never throws PluginContainerException; so, simply removing PluginContainerException from ConfigurationManagerRemote resolves the issue. Depending on how ayoung implements validation for raw config, that exception may get propagated.

Comment 2 John Sanda 2010-02-23 17:09:08 UTC
Debugging this was somewhat time consuming because the exception gets swallowed in RemoteClient.getManagers(). The exception is throw in that method, and it catches all exceptions and just prints a generic error message to std out. At a minimum, we should be logging the exception. And in the case of something like an InvocationTargetException where we know that actual exception is wrapped, we should at least attempt to log the underlying exception.

Comment 3 John Sanda 2010-05-26 20:25:29 UTC
This issue was resolved during development some time ago.


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