[libvirt-users] [libvirt] Connection using Java

Claudio Bley cbley at av-test.de
Tue Oct 16 07:06:10 UTC 2012


Hi.

At Tue, 2 Oct 2012 12:57:03 -0300,
Felipe Oliveira Gutierrez wrote:
> 
> My netcat version is v1.10-38 and I am using Debian on 192.XXX.XXX.XX
> 
> # nc -h
> [v1.10-38]
> connect to somewhere:    nc [-options] hostname port[s] [ports] ...
> listen for inbound:    nc -l -p port [-options] [hostname] [port]
> 
> I use Ubuntu to access the Debian machine, and now my Java class is like this:
> 
> public static void main(String[] args) {
>         Connect conn = null;
>         try {
>             conn = new Connect("xen+ssh://root@192.168.XXX.XX/?netcat=/bin/netcat", true);
> 
> but is still throwing the error:
> libvir: RPC error : End of file while reading data: /bin/netcat: invalid option -- 'U'
> nc -h for help: Input/output error
> exception caught:org.libvirt.LibvirtException: End of file while reading data: /bin/netcat: invalid option -- 'U'
> 
> I have files on the client machine that are /usr/bin/ncat , /bin/netcat and /etc/alternatives/netcat. I am not sure which I should use.

These are actually all the same. Run "update-alternatives --display nc"
to show the current config and list alternative choices.

Installing the OpenBSD nc ("sudo apt-get install netcat-openbsd") on
your Debian machine should solve this. Just use nc.openbsd in your
connection string to make sure it is used.
-- 
AV-Test GmbH, Henricistraße 20, 04155 Leipzig, Germany
Phone: +49 341 265 310 19
Web:<http://www.av-test.org>

Eingetragen am / Registered at: Amtsgericht Stendal (HRB 114076)
Geschaeftsfuehrer (CEO): Andreas Marx, Guido Habicht, Maik Morgenstern




More information about the libvirt-users mailing list