Home > Net >  Spring Batch Intellij gives error due to version. ( Just error Ultimate version )
Spring Batch Intellij gives error due to version. ( Just error Ultimate version )

Time:10-24

I am trying to create a Spring Batch project. And I am creating the project.

However, after purchasing intelllij idea ultimate version, my project started giving errors. I downloaded the "community" version again and my project is working :)

So what is the problem?

If I want to run my spring batch project with intelllij idea ultimate 2022.2 version. I cannot access any spring batch objects like JobBuilderFactory, StepBuilderFactory, ItemWriter, ItemReader etc.

But if I run the same project with the free version "community" there is no error and the project works.

I can't help going crazy :)

Could not autowire. No beans of 'JobBuilderFactory' type found

CodePudding user response:

I think this is because IntelliJ Idea is not able to detect that EnableBatchProcessing is importing these beans and adding them to the application context. This error is only a hint from the IDE. If you run the project with the ultimate edition, it should work as well.

There should be a difference between the community and ultimate edition WRT how to report this kind of errors, but if your app runs with the CE, it should also run with the UE.

CodePudding user response:

The project that worked in the CE version did not work in the Ultimate version. However, the problem was solved as follows.

I added @EnableBatchProcessing annotation in Spring Boot Application class and I think it included it in the context.

NOTE : Usually in batch applications, @EnableBatchProcessing anotation is included in the configuration class.

When I included it directly in the main class, the problem was solved. It was a strange error.

  • Related