-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Elias opened SPR-12522 and commented
Please see the code attached.
When a config variable is empty from a properties file and trying to convert it in a list of strings, spell cannot evaluate the expression. This code works in Spring 3.2.6. The output should be an empty list.
Caused by: org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1029E:(pos 20): A problem occurred when trying to execute method 'asList' on object of type 'java.lang.Class': 'Problem invoking method: public static java.util.List java.util.Arrays.asList(java.lang.Object[])'
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:164) ~[spring-context-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1362) ~[spring-beans-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:964) ~[spring-beans-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949) ~[spring-beans-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:816) ~[spring-beans-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:744) ~[spring-beans-4.1.2.RELEASE.jar:4.1.2.RELEASE]
... 62 common frames omitted
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1029E:(pos 20): A problem occurred when trying to execute method 'asList' on object of type 'java.lang.Class': 'Problem invoking method: public static java.util.List java.util.Arrays.asList(java.lang.Object[])'
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:136) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.expression.spel.ast.MethodReference.access$000(MethodReference.java:49) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.expression.spel.ast.MethodReference$MethodValueRef.getValue(MethodReference.java:342) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:88) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:120) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:242) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:161) ~[spring-context-4.1.2.RELEASE.jar:4.1.2.RELEASE]
... 67 common frames omitted
Caused by: org.springframework.expression.AccessException: Problem invoking method: public static java.util.List java.util.Arrays.asList(java.lang.Object[])
at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:116) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:129) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
... 73 common frames omitted
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.springframework.expression.spel.support.ReflectionHelper.isFirstEntryInArray(ReflectionHelper.java:350) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.expression.spel.support.ReflectionHelper.convertArguments(ReflectionHelper.java:285) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:106) ~[spring-expression-4.1.2.RELEASE.jar:4.1.2.RELEASE]
... 74 common frames omitted
Affects: 4.1.2
Attachments:
- application.properties (20 bytes)
- OrchestratorConfig.java (340 bytes)
Issue Links:
- Compiled SpEL expression fail when used with registered function [SPR-12359] #16964 Compiled SpEL expression fail when used with registered function
Referenced from: commits fa138d2
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug