Skip to content
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

BackToBackPatternClassifier does not work with delegate that implements Classifier [BATCH-2030] #1564

Closed
spring-issuemaster opened this issue May 22, 2013 · 4 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented May 22, 2013

Veit Hoffmann opened BATCH-2030 and commented

If BackToBackPatternClassifier has a delegate that inherits from "org.springframework.classify.Classifier" rather than using annotation "org.springframework.classify.annotation.Classifier" the
context creation fails with the Exception in the bottom of this description. The reason seems to be a problem in ClassifierAdapter which is called on setRouterDelegate.
The behavior can be reproduced with the test case attached.

Exception stack trace:

java.lang.IllegalStateException: More than one non-void public method detected with single argument.
at org.springframework.util.Assert.state(Assert.java:384)
at org.springframework.classify.util.MethodInvokerUtils$3.doWith(MethodInvokerUtils.java:202)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:473)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:481)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:451)
at org.springframework.classify.util.MethodInvokerUtils.getMethodInvokerForSingleArgument(MethodInvokerUtils.java:194)
at org.springframework.classify.ClassifierAdapter.setDelegate(ClassifierAdapter.java:84)
at org.springframework.classify.ClassifierAdapter.<init>(ClassifierAdapter.java:48)
at org.springframework.classify.BackToBackPatternClassifier.setRouterDelegate(BackToBackPatternClassifier.java:72)
at com.generali.appl.referenz.batch.multipleoutput.BackToBackPatternClassifierTests.testSetRouterDelegate(BackToBackPatternClassifierTests.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


Affects: 3.0.0, 2.2.0.RC2

Attachments:

1 votes, 5 watchers

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Sep 16, 2013

Krishna Bhamidipati commented

This is also a problem with Spring Batch 2.1.8

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Feb 20, 2014

Michael Minella commented

Since this is actually an issue with Spring Retry (not an actual batch artifact), I'm moving this to unscheduled. We can fix this and do a release independent of the Spring Batch release cycle.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Apr 1, 2015

Shenqiao Cheung commented

This is a problem in MethodInvokerUtils.getMethodInvokerForSingleArgument. I have fixed it and sent a pull request to "spring-projects/spring-retry".

@benas

This comment has been minimized.

Copy link
Contributor

@benas benas commented Jan 13, 2020

Based on the last two comments, I'm closing this issue (as it was reported and fixed in spring-retry project: spring-projects/spring-retry#28).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.