****
if (ApiProxy.getCurrentEnvironment() == null) {
RemoteApiInstaller installer = new RemoteApiInstaller();
try {
installer.install(remoteApiOptions);
} catch (IOException e) {
...
}
}
****Hi Baojun,
At first glance the code snippet provided seem to be ok, you can compare it to this example on Github to troubleshoot it.
As I understand the issue you are facing is intermittent so are you sure you are not sharing instances of the class RemoteApiInstaller across threads?
Also as your issue seems to be a specific technical issue you would have better assistance from the community by posting in StackOverflow as Google Groups is intended for general discussion