java.lang.reflect.InvocationTargetException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Noticed when using Folders plugin, but in principle could affect an installation using any plugin which has special {{ItemGroup}} implementations. {code} ... hudson.ExpressionFactory2$JexlExpression evaluate WARNING: Caught exception evaluating: it.parent == app. Reason: java.lang.reflect.InvocationTargetException java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314) at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185) at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTEQNode.value(ASTEQNode.java:71) at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54) at org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:56) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72) ... Caused by: java.lang.ClassCastException: <an ItemGroup impl> cannot be cast to jenkins.model.Jenkins at hudson.model.AbstractItem.getParent(AbstractItem.java) ... 91 more {code} Apparent cause is the use of {{@WithBridgeMethods(value=Jenkins.class,castRequired=true)}} in {{AbstractItem.getParent}}. Probable mechanism of bug is that {{Job/index.jelly}} evaluates {{it.parent}}, JEXL looks for a {{getParent()}} method, and picks the overload returning {{Jenkins}} rather than the one returning {{ItemGroup}}. If the job is in fact in a folder rather than at top level, the cast (generated in bytecode by a Maven plugin) fails. Might happen to work on JDK 6 due to {{Class.getMethods}} returning methods in bytecode order, but this is not the case in JDK 7. Symptom: stack trace in log; probably suppresses "This project is currently disabled" message. "Major" only in that the error can be thrown repeatedly for a wide class of jobs.
    via by Jesse Glick,
  • Noticed when using Folders plugin, but in principle could affect an installation using any plugin which has special {{ItemGroup}} implementations. {code} ... hudson.ExpressionFactory2$JexlExpression evaluate WARNING: Caught exception evaluating: it.parent == app. Reason: java.lang.reflect.InvocationTargetException java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314) at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185) at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTEQNode.value(ASTEQNode.java:71) at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54) at org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:56) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72) ... Caused by: java.lang.ClassCastException: <an ItemGroup impl> cannot be cast to jenkins.model.Jenkins at hudson.model.AbstractItem.getParent(AbstractItem.java) ... 91 more {code} Apparent cause is the use of {{@WithBridgeMethods(value=Jenkins.class,castRequired=true)}} in {{AbstractItem.getParent}}. Probable mechanism of bug is that {{Job/index.jelly}} evaluates {{it.parent}}, JEXL looks for a {{getParent()}} method, and picks the overload returning {{Jenkins}} rather than the one returning {{ItemGroup}}. If the job is in fact in a folder rather than at top level, the cast (generated in bytecode by a Maven plugin) fails. Might happen to work on JDK 6 due to {{Class.getMethods}} returning methods in bytecode order, but this is not the case in JDK 7. Symptom: stack trace in log; probably suppresses "This project is currently disabled" message. "Major" only in that the error can be thrown repeatedly for a wide class of jobs.
    via by Jesse Glick,
  • possible bug in cas plugin?
    via by Federico Paolantoni,
  • Warnings Plugin and Mail-ext Integration
    via by Darren Syzling,
  • Checkstyle Plugin - Jenkins - Jenkins Wiki
    via by Unknown author,
  • Jenkins users - Plugin - external dependencies
    via by Unknown author,
    • java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314) at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185) at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTEQNode.value(ASTEQNode.java:71) at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54) at org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:56) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)

    Users with the same issue

    davidvanlaatum
    davidvanlaatum2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    jf-ast
    jf-ast3 times, last one,
    109 more bugmates