Jenkins : My class is missing descriptor


Your Jenkins spits out a stack trace indicating that some classes are missing its descriptor, like the following.

Sometimes the InvocationTargetException is quite lengthy, so scroll down to see the nested cause that shows the class name that's missing Descriptor.

Nov 29, 2011 4:20:09 PM hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: descriptor.getPropertyType(instance,field).itemTypeDescriptorOrDie. Reason: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.apache.commons.jexl.util.PropertyExecutor.execute(
	at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(
	at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(
	at org.apache.commons.jexl.parser.ASTIdentifier.execute(
	at org.apache.commons.jexl.parser.ASTReference.execute(
	at org.apache.commons.jexl.parser.ASTReference.value(
	at org.apache.commons.jexl.parser.ASTReferenceExpression.value(
	at org.apache.commons.jexl.ExpressionImpl.evaluate(
	at hudson.ExpressionFactory2$JexlExpression.evaluate(
	at org.apache.commons.jelly.tags.core.CoreTagLibrary$
	at org.apache.commons.jelly.TagSupport.invokeBody(
	at org.apache.commons.jelly.tags.core.WhenTag.doTag(
Caused by: java.lang.AssertionError: class hudson.plugins.git.GitPublisher$TagToPush is missing its descriptor
	at jenkins.model.Jenkins.getDescriptorOrDie(
	at hudson.model.Descriptor$PropertyType.getItemTypeDescriptorOrDie(
	... 183 more

What does this mean?

This error is complaining that you are using some of the form tags incorrectly. It is currently a warning and non-fatal because otherwise it'll break too many plugins.

What the error is saying that you have some model classes that are used for form binding (those classes that are used in your constructor with the @DataBoundConstructor annotation), and those classes aren't Describable, when they should — making them Describable allows you to define help files, form validation check methods, and so on correctly.


Make those model classes Describable of themselves. That is, have them extend AbstractDescribableImpl, then define a nested Descriptor for itself. Since these are nested auxiliary desriptors, getDisplayName() can return the empty string.

class TagToPush extends AbstractDescribableImpl<TagToPush> {
    public TagToPush(...) { ... }


    public static class DescriptorImpl extends Descriptor<TagToPush> {
        public String getDisplayName() { return ""; }

See a real world example for the complete example.