From looking at your error message and answers, your problem is clear: both Tunaki and Glenn Lane are partially correct, and I voted for Glenn Lane to answer your question and I do it well.
From your answer to Glenn:
if (fileName.contains ("#")) {def (value1, value2) = fileName.split ("#") fileName = value1 + "% 23 #" + value2} I tried this. Still not working
Escape does not help the situation.
The character is already being processed somewhere along the execution chain, Tunaki was right about the type of error you had.
From your error log:
[ERROR] org.springframework.jms.listener.DefaultMessageListenerContainer # 0-1 [2015-02-05 10: 27: 23,607] - An error was detected performing the step org.springframework.batch.item.ItemStreamException: failed to initialize the reader
Combined with the exclusion of the state of the resource that Tunaki indicated, we can conclude that this is so. There is not enough information to say why or where this is happening, but there are two general categories:
Depending on how it enters or from the file vault, the symbol may already be deleted from the file at this point in the process or smoothed out in the Store like a File handler cannot handle it. For the reasons that Glenn pointed out.
Depending on the message or job processing in your run chain, it is deleted because it is converted to or from a URI / URL call. For the reasons that Glenn pointed out.
Yes. This is problem #. Once # is removed, it works great.
According to the statement above, a simple, quick and dirty solution would be to know about it and process it by deleting and inserting # directly from the file or uri as necessary. Based on a piece of code, you know how to do this.
The correct way to solve this problem is to track where the resource error occurs and make sure your file processing is consistent across the entire Job stream.
Without all the correct code here and / or knowing more about your system configuration, I cannot be specific. There is simply not enough information between the bean and the error log to tell exactly where this happens only in what exactly is your problem.
Here are a few suggestions:
I assume that you checked the Store file directly and manually deleted # and changed the file name in the job, and it runs based on your above statement.
Try to access the file in the repository from another Java object using the same identifier and it works; Then check if your element reader implementation works with file access.
If this failed or it is not a point of failure. Make sure that the value "#" is the job file, and if there is one and / or only # when you are splitting.
If all the checks figure out how they go to the file vault, and this resource can be correctly located in the vault, and this # is also not reserved in your implementation or requires special processing / configuration.
This will help reduce a simple cause.