Spring batch: Input resource does not exist class path resource

后端 未结 2 1554
轻奢々
轻奢々 2021-01-21 04:20

I am currently developing a Spring Batch which converts an Excel (.xsls) file to CSV in first step and then reads the CSV, processes it and stores its data in database. The firs

相关标签:
2条回答
  • 2021-01-21 04:34

    I found the solution. I should just add 'file:' to the output cvs file path. so it should be like this :

    batch.referentielAgenceCE.inputFilePathCSV=file\:C\:\\work\\referentielAgenceCE.csv instead of C\:\\work\\referentielAgenceCE.csv
    
    0 讨论(0)
  • 2021-01-21 04:37

    Seeing :

    Caused by: java.lang.IllegalStateException: Input resource must exist (reader is in 'strict' mode): URL [file://work//referentielAgenceCE.csv]
    

    And more precisely :

    file://work//referentielAgenceCE.csv
    

    I think you need to replace :

    batch.referentielAgenceCE.inputFilePathXLSX=C\:\\work\\referentielAgenceCE.xlsx
    batch.referentielAgenceCE.inputFilePathCSV=C\:\\work\\referentielAgenceCE.csv
    

    by

    batch.referentielAgenceCE.inputFilePathXLSX=C:\\work\\referentielAgenceCE.xlsx
    batch.referentielAgenceCE.inputFilePathCSV=C:\\work\\referentielAgenceCE.csv
    
    0 讨论(0)
提交回复
热议问题