1

We want to upload the excel file in our application and read the excel through asynchronous process to avoid delay in the synchronous reading. we want to use spring batch to read the excel file and I could not find any references other than spring-batch-extensions. spring-batch-extensions does not present in any maven repository to add as dependency rather source code is available git hub. Can someone help is there any better way to use spring-batch-extensions as dependency in the project instead of clone the code and build it as snapshot version ?

Muthu
  • 43
  • 1
  • 2
  • 10
  • And I could see some classes inside are deprecated such as JxlItemReader. Is there any better way to read excel sheet using asynchronous process ? – Muthu Apr 07 '17 at 13:21
  • Instead of the `JxlItemReader` use the `PoiItemReader`. I'm afraid there (currently) isn't another way to include the code as the artifacts aren't available in any repo. I'm the original author but I don't have access to that repo I'm afraid. – M. Deinum Apr 07 '17 at 13:29
  • Thanks M. Deinum for the answer. In that case are we allowed to create a separate project or maven module to build this code and remove these deprecated classes such as JxlItemReader from our source code and use it in our application ? – Muthu Apr 07 '17 at 13:41
  • Could you please let me know whether we are allowed to use only the required files instead of keeping the deprecated files. because this is Licensed under the Apache License, Version 2.0 – Muthu Apr 07 '17 at 14:18
  • Go ahead, feel free as you do. But except from a cleanup what do you gain from removing those classes? – M. Deinum Apr 09 '17 at 10:02
  • Thank you very much for sharing such wonderful extensions. The reason I want to clean up is that to avoid code quality issues due to deprecated classes – Muthu Apr 09 '17 at 11:21
  • How can I pass the resource name as job parameter in the spring-batch-excel ? for e.g. – Muthu Apr 10 '17 at 19:09
  • That should work just like for other readers, it has to be either step or job scoped to work with late binding.. – M. Deinum Apr 11 '17 at 05:07
  • I have set the file resource parameter in step scope as follows but I am getting java.lang.IllegalStateException: InputStream MUST either support mark/reset, or be wrapped as a PushbackInputStream. – Muthu Apr 11 '17 at 05:38
  • You shouldn't need to convert it to a `FileSystemResource` as Spring already does that, you are making things to complex here. – M. Deinum Apr 11 '17 at 05:59
  • Thanks for pointing out the issue, It is working when I pass it as file resource – Muthu Apr 11 '17 at 06:15
  • Spring batch extension for excel throws Parsing error when the excel sheet contains empty cells other than the data cells. For e.g. If the sheet contains 3 rows of data and remaining cells are empty, it is trying to read all the empty cells and throws parsing error when there is no data present. Could anyone please explain how to handle this scenario irrespective of any number of cells present, it should read only the rows containing data and ignore the empty rows ? – Muthu Jun 26 '17 at 19:23
  • If you have a question please ask a new question don't add another comment as a question. – M. Deinum Jun 26 '17 at 19:42

0 Answers0