Skip to content

SpEL invocation for functional interfaces cannot find the method for signature #3079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
artembilan opened this issue Oct 15, 2019 · 1 comment · Fixed by #3082
Closed

SpEL invocation for functional interfaces cannot find the method for signature #3079

artembilan opened this issue Oct 15, 2019 · 1 comment · Fixed by #3082
Assignees
Milestone

Comments

@artembilan
Copy link
Member

See more info in the https://stackoverflow.com/questions/58259113/how-transform-string-in-subflow-route-using-spring-integration-dsl.

When we can't process an empty payload via PayloadMethodArgumentResolver, we fallback to SpEL execution and here it try to find a method in the interface implementation, but cannot, because there is no an abstract method in the list of target methods.

Looks like an assumption about:

TRANSFORMER_TRANSFORM_METHOD =
				ReflectionUtils.findMethod(genericTransformerClass, "transform", (Class<?>[]) null);

to be used in the FixedMethodFilter for SpEL invoker is wrong and we need to resolve non-lambda methods other way.

@artembilan
Copy link
Member Author

Related issue on SF side: spring-projects/spring-framework#23812

@artembilan artembilan self-assigned this Oct 15, 2019
artembilan added a commit to artembilan/spring-integration that referenced this issue Oct 15, 2019
Fixes spring-projects#3079

It turns out that we need to use a *most specific* method for the target
to be called reflectively from the SpEL

NOTE: We drop a *Method not found* error in case of wrong method source
since now we find a right source via `ClassUtils.getMostSpecificMethod()`

**Cherry-pick to 5.1.x**
artembilan added a commit to artembilan/spring-integration that referenced this issue Oct 16, 2019
Fixes spring-projects#3079

It turns out that we need to use a *most specific* method for the target
to be called reflectively from the SpEL

NOTE: We drop a *Method not found* error in case of wrong method source
since now we find a right source via `ClassUtils.getMostSpecificMethod()`

**Cherry-pick to 5.1.x**
garyrussell pushed a commit that referenced this issue Oct 16, 2019
* GH-3079: Use getMostSpecificMethod for SpEL calls

Fixes #3079

It turns out that we need to use a *most specific* method for the target
to be called reflectively from the SpEL

NOTE: We drop a *Method not found* error in case of wrong method source
since now we find a right source via `ClassUtils.getMostSpecificMethod()`

**Cherry-pick to 5.1.x**

* * `@Ignore` `MethodInvokingMessageProcessorTests.testProcessMessageMethodNotFound()`
instead of removal
garyrussell pushed a commit that referenced this issue Oct 16, 2019
* GH-3079: Use getMostSpecificMethod for SpEL calls

Fixes #3079

It turns out that we need to use a *most specific* method for the target
to be called reflectively from the SpEL

NOTE: We drop a *Method not found* error in case of wrong method source
since now we find a right source via `ClassUtils.getMostSpecificMethod()`

**Cherry-pick to 5.1.x**

* * `@Ignore` `MethodInvokingMessageProcessorTests.testProcessMessageMethodNotFound()`
instead of removal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant