I'm new to Jclouds and I used a simple program to understand basic functionality of Jclouds. I used Cloudstack as my Iaas. I installed cloudstack in my localhost and I can connect to cloudstack using localhost. But I'm getting an exception when I run the program.
This is the link of the source code I used. https://gist.github.com/everett-toews/3361018#file-jcloudstest-java //credentials String provider = "cloudstack"; String identity = "6e48e096-3f61-11e4-bfed-080027ce083d"; //for admin user String apiKey = "YhxLjT8r6cnpkkMuAMTqKaIg__UdJUFVew6q8NwwhhYoS7U0skSaT9gHwwd1N_7g33YlOtSc8ihaHLdKxa0wlA"; *exception*: Calling listNodes... Sep 19, 2014 12:16:49 PM org.jclouds.logging.jdk.JDKLogger logError SEVERE: Cannot retry after server error, command has exceeded retry limit 5: [method=org.jclouds.cloudstack.features.VirtualMachineApi.public abstract java.util.Set org.jclouds.cloudstack.features.VirtualMachineApi.listVirtualMachines(org.jclouds.cloudstack.options.ListVirtualMachinesOptions[])[[Lorg.jclouds.cloudstack.options.ListVirtualMachinesOptions;@374f910c], request=GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&listAll=true HTTP/1.1] org.jclouds.rest.AuthorizationException: { "listvirtualmachinesresponse" : {"uuidList":[],"errorcode":401,"errortext":"unable to verify user credentials and/or request signature"} } at org.jclouds.cloudstack.handlers.CloudStackErrorHandler.handleError(CloudStackErrorHandler.java:56) at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65) at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:135) at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:105) at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:91) at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74) at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45) at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117) at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87) at com.sun.proxy.$Proxy57.listVirtualMachines(Unknown Source) at org.jclouds.cloudstack.compute.strategy.CloudStackComputeServiceAdapter.listNodes(CloudStackComputeServiceAdapter.java:303) at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:122) at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listNodes(AdaptingComputeServiceStrategies.java:112) at org.jclouds.compute.internal.BaseComputeService.listNodes(BaseComputeService.java:335) at org.jclouds.my.JCloudsTest.listServers(JCloudsTest.java:25) at org.jclouds.my.JCloudsTest.main(JCloudsTest.java:18) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: org.jclouds.http.HttpResponseException: command: GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&listAll=true HTTP/1.1 failed with response: HTTP/1.1 401 Unauthorized; content: [{ "listvirtualmachinesresponse" : {"uuidList":[],"errorcode":401,"errortext":"unable to verify user credentials and/or request signature"} }] at org.jclouds.cloudstack.handlers.CloudStackErrorHandler.handleError(CloudStackErrorHandler.java:45) ... 20 more Any ideas? -- Thanks, Regards, ASH
