[libvirt-users] Beware! Newbie is in town

Hello everyone, I'm working on Ubuntu 10.10, installed libvirt and created a project in Netbeans, I included jna.jar and libvirt-0.4.7.jar. And guess what, I get the exception below when I'm trying to run test.java which connects to test:///default. Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237) at com.sun.jna.Library$Handler.<init>(Library.java:140) at com.sun.jna.Native.loadLibrary(Native.java:374) at com.sun.jna.Native.loadLibrary(Native.java:359) at org.libvirt.jna.Libvirt.<clinit>(Unknown Source) at org.libvirt.Connect.<clinit>(Unknown Source) at novatest_v01.Main.main(Main.java:21) I'm sure this question has been asked dozens of times, sorry. But any answer/comment is appreciated. Thanks Kadir

And this also happens when I try to call virsh in command line. 2011/3/14 kadir yüceer <kadiryuceer@gmail.com>
Hello everyone, I'm working on Ubuntu 10.10, installed libvirt and created a project in Netbeans, I included jna.jar and libvirt-0.4.7.jar. And guess what, I get the exception below when I'm trying to run test.java which connects to test:///default.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237) at com.sun.jna.Library$Handler.<init>(Library.java:140) at com.sun.jna.Native.loadLibrary(Native.java:374) at com.sun.jna.Native.loadLibrary(Native.java:359) at org.libvirt.jna.Libvirt.<clinit>(Unknown Source) at org.libvirt.Connect.<clinit>(Unknown Source) at novatest_v01.Main.main(Main.java:21)
I'm sure this question has been asked dozens of times, sorry. But any answer/comment is appreciated.
Thanks Kadir

2011/3/15 Berend Dekens <berend@cyberwizzard.nl>
It looks to me like you don't have libvirt set up properly as the ".so" file is a library which should be available in a system default location.
Well I downloaded libvirt-0.8.8.tar.gz<http://libvirt.org/sources/libvirt-0.8.8.tar.gz>and run ./configure; make; install successfully. And I'm logged in as root(always). Is there something else that I should do, except adding jna.jar and the jar file within libvirt-java-0.4.7.tar.gz<http://libvirt.org/sources/java/libvirt-java-0.4.7.tar.gz>to the libraries section of my java project? I'm trying to run the sample code test.java on http://libvirt.org/java.html. Regards Kadir
Regards, Berend Dekens
On 15/03/11 08:45, kadir yüceer wrote:
And this also happens when I try to call virsh in command line.
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

2011/3/15 Berend Dekens <berend@cyberwizzard.nl <mailto:berend@cyberwizzard.nl>>
It looks to me like you don't have libvirt set up properly as the ".so" file is a library which should be available in a system default location.
Well I downloaded libvirt-0.8.8.tar.gz <http://libvirt.org/sources/libvirt-0.8.8.tar.gz> and run ./configure; make; install successfully. And I'm logged in as root(always). Is there something else that I should do, except adding jna.jar and the jar file within libvirt-java-0.4.7.tar.gz <http://libvirt.org/sources/java/libvirt-java-0.4.7.tar.gz> to the libraries section of my java project? I'm trying to run the sample code test.java on http://libvirt.org/java.html. The fact that virsh throws the same error means you can leave the Java bit for now and focus on virsh instead: as long as that does not work,
On 15/03/11 09:08, kadir yüceer wrote: the Java bindings will not either. On a side note: you might want to use your distributions package manage to install libvirt so all the files end up in the correct paths. My guess is that you currently install files into the wrong location. Regards, Berend Dekens

2011/3/15 kadir yüceer <kadiryuceer@gmail.com>:
2011/3/15 Berend Dekens <berend@cyberwizzard.nl>
It looks to me like you don't have libvirt set up properly as the ".so" file is a library which should be available in a system default location.
Well I downloaded libvirt-0.8.8.tar.gz and run ./configure; make; install successfully. And I'm logged in as root(always). Is there something else that I should do, except adding jna.jar and the jar file within libvirt-java-0.4.7.tar.gz to the libraries section of my java project? I'm trying to run the sample code test.java on http://libvirt.org/java.html.
Running just ./configure without any options should make it install under the /usr/local prefix. /usr/local/bin should be in PATH by default, that's why you can run virsh, but ld fails to find libvirt.so. Did you try to run ldconfig as root to update ld's cache? That might help. Matthias

ldconfig seemed to perform the magic. Everything is working right now, and also netbeans, when I run libvirtd beforehand. Thanks for help. Kind regards Kadir 2011/3/15 Matthias Bolte <matthias.bolte@googlemail.com>
2011/3/15 kadir yüceer <kadiryuceer@gmail.com>:
2011/3/15 Berend Dekens <berend@cyberwizzard.nl>
It looks to me like you don't have libvirt set up properly as the ".so" file is a library which should be available in a system default
location.
Well I downloaded libvirt-0.8.8.tar.gz and run ./configure; make; install successfully. And I'm logged in as root(always). Is there something else that I should do, except adding jna.jar and the jar file within libvirt-java-0.4.7.tar.gz to the libraries section of my java project?
I'm
trying to run the sample code test.java on http://libvirt.org/java.html.
Running just ./configure without any options should make it install under the /usr/local prefix. /usr/local/bin should be in PATH by default, that's why you can run virsh, but ld fails to find libvirt.so.
Did you try to run ldconfig as root to update ld's cache? That might help.
Matthias
participants (3)
-
Berend Dekens
-
kadir yüceer
-
Matthias Bolte