[libvirt] Java Bindings ConnectAuthDefault callback never called

Sergio Rodriguez de Guzman srguzman at gmail.com
Mon Apr 14 21:32:08 UTC 2014


I'm following the instructions mentioned in the list some years ago about
using a subclass of ConnectAuth using ConnectAuthDefault as a sample:

"You could create your own
subclass of ConnectAuth, and override the method:"


public abstract int callback(Credential[] cred);


What I'm doing is just "copying" ConnectAuthDefault to ConnectAuthAlternate
and using exactly the same code. The thing is that the callback defined in
that class never fires:

ConnectAuth defaultAuth = new ConnectAuthAlternate();

try{

conn = new Connect("qemu+ssh://student@10.164.1.21/system", defaultAuth, 0);

} catch

  (LibvirtException e){ System.out.println("exception caught:"+e);

  System.out.println(e.getError());

}


It works as expected, asks for the user password and connects successfully
but it never reaches the callback defined in ConnectAuthAlternate (aka
ConnectAuthDefault):

@Override

public int callback(Credential[] cred) {

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

[...]


I'm using libvirt-java 0.5.1, JNA 4.1 and the current libvirt version that
comes with ubuntu 13.10: 1.1.1-0ubuntu8.5


Could you give some light about this?.

Sergio.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140414/3a8ea6ed/attachment-0001.htm>


More information about the libvir-list mailing list