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
WARN: @Bean method StepScopeConfiguration.stepScope is non-static [BATCH-2161] #1434
Comments
Guilherme Trein commented The same happens with ScopeConfiguration.jobScope. |
Diego Magalhaes commented +bump, still happening. Is it safe to just add the static keyword to both? |
Dave Syer commented Are there any side effects. I see a comment in the source code indicating that it was intentionally non-static. So what's the problem? |
matt crowe commented I see the same message in the logs. I am not setting the StepScope. I am using |
Michael Minella commented matt crowe, |
matt crowe commented Thanks for the reply. I actually was aware that the StepScope setup was being done for me as part of that annotation. But should the warning just be ignored? i.e. is it more of an info message, or is my configuration not in an optimal state. (My Job, with 2 steps, seems to work fine. It is called once per day.) |
Michael Minella commented Yes. It should be ignored. It comes from Spring Core (not Spring Batch). Your application is doing nothing wrong, Batch just doesn't have a way to suppress that warning. |
Jean-Pierre Bergamin commented Why not declaring the stepScope bean |
matt crowe commented Michael, Thanks for letting me know that the warn is to be expected in this case. Jean-Pierre, I don't declare the StepScope, as it is configured as part of |
Diego Magalhaes commented
on all my spring batch logback.xml files to avoid this message. |
matt crowe commented
|
Philippe Marschall commented pull request: |
Alexander Wingert commented Any news on this? |
Michael Minella commented There is a comment in the code that we did not want the methods to be static. The warning this produces is not a Spring Batch one, it's Spring Core which does not apply to the use case implemented here (We are not processing |
Sander Verhagen commented People are clearly trying to reduce errors and warnings in their log files, and out of the box this seems to be working with Spring (Boot) in such a way that a warning comes up. I see the comment you're referring to, and I wouldn't want |
Philippe Marschall commented
|
Mahmoud Ben Hassine commented The status of the issue was updated to "Fixed". This improvement will be part of next release. |
Jean-Pierre Bergamin opened BATCH-2161 and commented
When using Java based configuration and the
@StepScope
annotation you get the following warning in the logs, when starting the application context:A short glimpse at the StepScopeConfiguration class lets me think that the stepScope bean really can be declared static.
See also the last chapter "BeanFactoryPostProcessor-returning
@Bean
methods" in the @Bean api documentation.Affects: 3.0.0
Issue Links:
@Bean
method that support custom scope("is duplicated by")
Backported to: 3.0.9
16 votes, 23 watchers
The text was updated successfully, but these errors were encountered: