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:
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?
OkHttpUtils2 methods are designed to be called on the main thread. This is the case in all platforms and configurations, except of B4J server solutions. Starting from jOkHttpUtils2 v2.95 it is possible to make it thread safe. This is done by following these steps: 1. Add the SERVER conditional...
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:
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.