Announcement Announcement Module
Collapse
No announcement yet.
Reading from network resource fails Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading from network resource fails

    Hi!

    I currently have a problem reading from a network resource.

    My FlatFileItemReader has a property "resource" looking like this;
    Code:
    <property name="resource" value="file:/#{jobParameters[FILEPATH]}"/>
    When the jobParameter FILEPATH = c:\test.csv it works...., but if I input \\testserver\sharename\file.csv, it fails;

    Code:
    Input resource must exist (reader is in 'strict' mode): URL [file:/my-pc/shared/test.csv]
    Does anyone got a solution to this?

  • #2
    Hello,

    I am also trying to find out how to pass a file name with full path to the Spring Batch Application. Are you using the CommandLineJobRunner to execute your job? If so, are you passing the FILEPATH argument as a job parameter? Is it possible for you share that command example if you are using CommandLineJobRunner?

    Thanking you.

    Comment


    • #3
      This is really an issue with the how the underlying Spring Resource abstraction is dealing with your resource (You may want to try the general spring forum for that). However, if the file is anything but trivially small, wouldn't it be better to transfer it to the local machine and read it in from there?

      Comment


      • #4
        Originally posted by lucasward View Post
        This is really an issue with the how the underlying Spring Resource abstraction is dealing with your resource (You may want to try the general spring forum for that). However, if the file is anything but trivially small, wouldn't it be better to transfer it to the local machine and read it in from there?
        Yes ... after digging a bit more, I see that it's the Spring Resource that doesn't support this. I'll try the general Spring forum.

        The file .... well... 2-8MB. However, as this is something that's going to be used by a client and not by me personally, this is sadly a requirement, and I must do it this way. ........ or I could introduce a step that gets the file from the network and places it locally..... and give the new path to the reader....

        Comment

        Working...
        X