[one-users] Haven't authorized while using Java API
Hoàng Thái Xuân Khoa
htxuankhoa at gmail.com
Sun Nov 25 06:21:25 PST 2012
Hello everybody,
I have successfully managed private cloud using command line. And then i
tried to write a simple program to test Java API. But when i use Java
API, i haven't authorized. I don't know why because i have had one_auth
file & i have successfully deployed virtual machine running in computer
nodes by using command line. My Netbeans IDE runs under oneadmin user.
_Here is my program in Java:_
package exampleusingopennebulaapi;
import org.opennebula.client.Client;
import org.opennebula.client.OneResponse;
import org.opennebula.client.host.HostPool;
/**
*
* @author oneadmin
*/
public class ExampleUsingOpenNebulaAPI {
public static void main(String[] args) throws Exception {
Client client = new Client();
OneResponse or = HostPool.info(client);
if (or.isError()) {
System.out.println("Error message: " + or.getErrorMessage());
}
else{
System.out.println("No errors. This is xml content: " +
or.getMessage());
}
}
}
And this is result i got:
Error message: [HostPoolInfo] User couldn't be authenticated, aborting call.
Can somebody help me? Thanks in advance.
--
Hoang Thai Xuan Khoa
Ho Chi Minh city, Vietnam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20121125/833adf26/attachment.htm>
More information about the Users
mailing list