VMware Cloud Community

hqapi command line tools invocation issue

i am having difficulty invoking hqapi.
i placed the following class of the hqapi client:


but it still throws the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/hyperic/hq/hqapi1/tools/Shell
Caused by: java.lang.ClassNotFoundException: org.hyperic.hq.hqapi1.tools.Shell
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: org.hyperic.hq.hqapi1.tools.Shell. Program will exit.

I put the hqapi jar from my Hyperic release (which is enterprise 4.2) into the lib directory of the hqapi command line tools and it works. I am not sure why this isn't included in the hqapi tools distribution, but it might want to be noted in the documentation somewhere (http://support.hyperic.com/display/DOC/HQ+API+Command-Line+Tools#HQAPICommand-LineTools-CommonRequiredCommandQualifiers).
0 Kudos
1 Reply


You shouldn't need to place the jar anywhere. I think you've hit a bug with the way the hqapi.sh script searches for classes. It's been fixed in the latest source code of hqapi http://jira.hyperic.com/browse/HHQ-3740

If you were invoking hqapi from a symlink'd directory or from outside the directory of the client you'd get an error similar to what you saw.
0 Kudos