B4J Question j.Download gives java.io.FileNotFoundException (Input/output error)

simonwilliamson

Member
Licensed User
I have created a Server application that calls a 2nd server application (using j.PostString) to tell this 2nd server to request a file from the 1st server. All works well until the 2nd server receives this file from the 1st server (j.Success = True) and tries to copy the Stream into a file using File.Copy2 where it gives the following error:

java.io.FileNotFoundException: /media/pss-admin/pssDrive2/file_store/4e3f015a-3930-41ac-84d0-cb707ab70ca7.jpg (Input/output error).

Is this due to some sort of threading issue because the 2nd server is making a Download request while still dealing with the ServletRequest request that came from the 1st server?
 

aeric

Expert
Licensed User
Longtime User
I think you should post a small example or sample code.
This error message usually showed when you try to read the results of a job when it failed.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
This thread may be relevant.
 
Upvote 0

jkhazraji

Active Member
Licensed User
Longtime User
I have created a Server application that calls a 2nd server application (using j.PostString) to tell this 2nd server to request a file from the 1st server. All works well until the 2nd server receives this file from the 1st server (j.Success = True) and tries to copy the Stream into a file using File.Copy2 where it gives the following error:

java.io.FileNotFoundException: /media/pss-admin/pssDrive2/file_store/4e3f015a-3930-41ac-84d0-cb707ab70ca7.jpg (Input/output error).

Is this due to some sort of threading issue because the 2nd server is making a Download request while still dealing with the ServletRequest request that came from the 1st server?
There are many issues that may cause this error like File system issue, stream state, concurrency issue, File Path or File Name Issue, or servlet lifecycle conflict. To start with, wrap the File.Copy2 call in a try-catch block and log the LastException.Message to get more insights.
 
Upvote 0
Top