Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68714

libvert plugin running into java.lang.NoClassDefFoundError: Could not initialize class org.libvirt.Library

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Blocker Blocker
    • libvirt-slave-plugin
    • None

      I am trying to configure libvert plugin with the latest stable version of Jenkins but I keep running into 

      java.lang.NoClassDefFoundError: Could not initialize class org.libvirt.Library

      Jenkins Version: 2.332.3

      OS(Redhat7) virsh --version
      4.5.0

          [JENKINS-68714] libvert plugin running into java.lang.NoClassDefFoundError: Could not initialize class org.libvirt.Library

          Richard added a comment -

          Did you install the libvirt library on the Jenkins host system? (https://plugins.jenkins.io/libvirt-slave/#plugin-content-requirements)

          Richard added a comment - Did you install the libvirt library on the Jenkins host system? ( https://plugins.jenkins.io/libvirt-slave/#plugin-content-requirements )

          qingfu added a comment - - edited

          I also encouter this issue. I have installed `libvirt` on my jenkins server in a docker container, which is debian 11, using the following command:

          apt-get install libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon -y 

          qingfu added a comment - - edited I also encouter this issue. I have installed `libvirt` on my jenkins server in a docker container, which is debian 11, using the following command: apt-get install libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon -y

          Andrei added a comment -

          I have similar error, all libvirt libraries and tools have installed. 

          Andrei added a comment - I have similar error, all libvirt libraries and tools have installed. 

          Wade added a comment -

          I've found that the Jenkins server needs to be restarted after installing the libvirt dependencies.  The "Test Connection" button is the most telling here.  If the dependencies are not available then an error message is returned:

          However, clicking the "Test Connection" button again then triggers an error along with the "java.lang.NoClassDefFoundError: Could not initialize class org.libvirt.Library" error message in the logs:

          This error will persist, even if the dependencies are installed, until the Jenkins server is restarted.

          Expected behavior is for the plugin to be able to fail gracefully if it cannot load its dependencies.  Ideally the plugin would be able to re-try loading its dependencies, but informing the user that a restart will be required after installing the dependencies would also suffice.

          Last tested on Ubuntu 22.04, Jenkins 2.426.1, Libvirt Agents plugin 262.v98a_c85b_98c0a_.

          Wade added a comment - I've found that the Jenkins server needs to be restarted after installing the libvirt dependencies.  The "Test Connection" button is the most telling here.  If the dependencies are not available then an error message is returned: However, clicking the "Test Connection" button again then triggers an error along with the "java.lang.NoClassDefFoundError: Could not initialize class org.libvirt.Library" error message in the logs: This error will persist, even if the dependencies are installed, until the Jenkins server is restarted. Expected behavior is for the plugin to be able to fail gracefully if it cannot load its dependencies.  Ideally the plugin would be able to re-try loading its dependencies, but informing the user that a restart will be required after installing the dependencies would also suffice. Last tested on Ubuntu 22.04, Jenkins 2.426.1, Libvirt Agents plugin 262.v98a_c85b_98c0a_.

            m_jeanson Michael
            alok15ee Alok Singh
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: