Results 1 to 4 of 4

Thread: Reading from network resource fails

  1. #1
    Join Date
    Jul 2009
    Posts
    15

    Question 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. #2

    Default

    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.

  3. #3
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    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?

  4. #4
    Join Date
    Jul 2009
    Posts
    15

    Default

    Quote 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....

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •