Issue Type: Bug Bug
Assignee: jglick
Components: core
Created: 05/Jul/12 4:22 PM
Description:

Noticed when using Folders plugin, but in principle could affect an installation using any plugin which has special ItemGroup implementations.

... 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

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.

Environment: 1.424, JDK 7
Project: Jenkins
Labels: exception
Priority: Major Major
Reporter: jglick
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to