java.lang.reflect.InvocationTargetException

Jenkins JIRA | Jesse Glick | 4 years ago
  1. 0

    [JENKINS-14325] CCE "...cannot be cast to jenkins.model.Jenkins" in job index page - Jenkins JIRA

    jenkins-ci.org | 11 months ago
    java.lang.reflect.InvocationTargetException
  2. 0

    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.

    Jenkins JIRA | 4 years ago | Jesse Glick
    java.lang.reflect.InvocationTargetException
  3. 0

    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.

    Jenkins JIRA | 4 years ago | Jesse Glick
    java.lang.reflect.InvocationTargetException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    possible bug in cas plugin?

    Google Groups | 4 years ago | Federico Paolantoni
    java.lang.reflect.InvocationTargetException
  6. 0

    Warnings Plugin and Mail-ext Integration

    Google Groups | 5 years ago | Darren Syzling
    java.lang.reflect.InvocationTargetException

  1. davidvanlaatum 2 times, last 4 months ago
  2. r1chjames 1 times, last 3 days ago
  3. bmacedo 8 times, last 3 weeks ago
  4. aldrinleal 1 times, last 1 month ago
  5. ajinkya_w 96 times, last 2 months ago
18 more registered users
76 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.reflect.InvocationTargetException

    No message provided

    at sun.reflect.NativeMethodAccessorImpl.invoke0()
  2. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:601)
    4 frames
  3. Commons JEXL
    ExpressionImpl.evaluate
    1. org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
    2. org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
    3. org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
    4. org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
    5. org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
    6. org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
    7. org.apache.commons.jexl.parser.ASTEQNode.value(ASTEQNode.java:71)
    8. org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54)
    9. org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:56)
    10. org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
    10 frames
  4. Hudson
    ExpressionFactory2$JexlExpression.evaluate
    1. hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
    1 frame