java.lang.reflect.InvocationTargetException

Jenkins JIRA | Felix Wohlfrom | 6 months ago
  1. 0

    I get the following exception in the the latest update of gerrit trigger plugin: {code:java} Jun 02, 2016 7:38:09 PM com.sonymobile.tools.gerrit.gerritevents.GerritHandler notifyListener SEVERE: Exception thrown during event handling. java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.sonymobile.tools.gerrit.gerritevents.GerritHandler.notifyListener(GerritHandler.java:316) at com.sonymobile.tools.gerrit.gerritevents.GerritHandler.notifyListeners(GerritHandler.java:296) at com.sonyericsson.hudson.plugins.gerrit.trigger.JenkinsAwareGerritHandler.notifyListeners(JenkinsAwareGerritHandler.java:77) at com.sonymobile.tools.gerrit.gerritevents.workers.AbstractGerritEventWork.perform(AbstractGerritEventWork.java:46) at com.sonymobile.tools.gerrit.gerritevents.workers.GerritEventWork.perform(GerritEventWork.java:48) at com.sonymobile.tools.gerrit.gerritevents.workers.EventThread.run(EventThread.java:66) at com.sonyericsson.hudson.plugins.gerrit.trigger.SystemEventThread.run(SystemEventThread.java:66) Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener$ParametersActionInspection.<init>(EventListener.java:435) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.getParametersInspection(EventListener.java:391) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.createParameters(EventListener.java:269) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.schedule(EventListener.java:188) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.schedule(EventListener.java:164) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.gerritEvent(EventListener.java:126) ... 10 more Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376) at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326) at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) {code} It looks like in the following commit the dependency to apache commons lang 3 was introduced: [https://github.com/jenkinsci/gerrit-trigger-plugin/pull/285/files#diff-54e50e5c447d3a893fd786bd419ee8b4R46] This dependency is resolved during build time via the rabbitmq-consumer plugin. Since this plugin is optional, the class will not be found if this plugin is not installed. There are now two possibilities to fix this (which is why I didn't create a pull request in the first place): # Replace in class 'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener' the import 'org.apache.commons.lang3.StringUtils' with 'org.apache.commons.lang.StringUtils'. This class is available with core jenkins installation. # Explicitely add apache commons-lang3 to the dependencies of gerrit trigger plugin to make sure it is always imported.

    Jenkins JIRA | 6 months ago | Felix Wohlfrom
    java.lang.reflect.InvocationTargetException
  2. 0

    I get the following exception in the the latest update of gerrit trigger plugin: {code:java} Jun 02, 2016 7:38:09 PM com.sonymobile.tools.gerrit.gerritevents.GerritHandler notifyListener SEVERE: Exception thrown during event handling. java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.sonymobile.tools.gerrit.gerritevents.GerritHandler.notifyListener(GerritHandler.java:316) at com.sonymobile.tools.gerrit.gerritevents.GerritHandler.notifyListeners(GerritHandler.java:296) at com.sonyericsson.hudson.plugins.gerrit.trigger.JenkinsAwareGerritHandler.notifyListeners(JenkinsAwareGerritHandler.java:77) at com.sonymobile.tools.gerrit.gerritevents.workers.AbstractGerritEventWork.perform(AbstractGerritEventWork.java:46) at com.sonymobile.tools.gerrit.gerritevents.workers.GerritEventWork.perform(GerritEventWork.java:48) at com.sonymobile.tools.gerrit.gerritevents.workers.EventThread.run(EventThread.java:66) at com.sonyericsson.hudson.plugins.gerrit.trigger.SystemEventThread.run(SystemEventThread.java:66) Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener$ParametersActionInspection.<init>(EventListener.java:435) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.getParametersInspection(EventListener.java:391) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.createParameters(EventListener.java:269) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.schedule(EventListener.java:188) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.schedule(EventListener.java:164) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.gerritEvent(EventListener.java:126) ... 10 more Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376) at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326) at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) {code} It looks like in the following commit the dependency to apache commons lang 3 was introduced: [https://github.com/jenkinsci/gerrit-trigger-plugin/pull/285/files#diff-54e50e5c447d3a893fd786bd419ee8b4R46] This dependency is resolved during build time via the rabbitmq-consumer plugin. Since this plugin is optional, the class will not be found if this plugin is not installed. There are now two possibilities to fix this (which is why I didn't create a pull request in the first place): # Replace in class 'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener' the import 'org.apache.commons.lang3.StringUtils' with 'org.apache.commons.lang.StringUtils'. This class is available with core jenkins installation. # Explicitely add apache commons-lang3 to the dependencies of gerrit trigger plugin to make sure it is always imported.

    Jenkins JIRA | 6 months ago | Felix Wohlfrom
    java.lang.reflect.InvocationTargetException
  3. 0

    RunListener failed - Build Passes do not update commit statuses

    GitHub | 1 year ago | techman83
    java.lang.NoClassDefFoundError: hudson/tasks/test/TestObject
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Do not depend on cobertura plugin

    GitHub | 11 months ago | kwisatz
    java.lang.NoClassDefFoundError: hudson/plugins/cobertura/CoberturaBuildAction

  1. davidvanlaatum 22 times, last 6 months ago
  2. poroszd 1 times, last 2 months ago
22 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    org.apache.commons.lang3.StringUtils

    at jenkins.util.AntClassLoader.findClassInComponents()
  2. jenkins.util
    AntClassLoader.loadClass
    1. jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
    2. jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
    3. jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
    3 frames
  3. Java RT
    ClassLoader.loadClass
    1. java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    1 frame